Dear Johannes,
I believe this is similar to querying the DTN neighbors? This is what I did to query the DTN neighbors in python:
1) Query LOCALHOST and port 4550, via socket (fsock) 2) Read header [fsock.readline()] to listen to incoming information from socket. 3) Switch into management protocol mode by [sock.send("protocol management\n")] 4) Read protocol switch message [fsock.readline()] 5) Query neighbor list [sock.send("neighbor list\n")] 6) The data returned from the socket can now be filtered out to know the DTN neighbors. Works perfectly, no problem!!
However, this event mechanism you have mentioned is still a bit blurry to me, apologies. For the steps above:
- must I send "protocol extended" or "protocol event" for Step 3 mentioned above? - When I send protocol extended, all I get is: 200 SWITCHED TO EXTENDED - Reading from the socket hangs, because there isn't anything to read anymore.
Where am I going wrong. I just require the data of the crossed over bundles via my current node.
Many thanks, Shyam
On Wed, Jan 15, 2014 at 12:31 PM, Johannes Morgenroth < morgenroth@ibr.cs.tu-bs.de> wrote:
Am 14.01.2014 13:22, schrieb Shyam B:
I looked up the internet, but I could not get a clear idea on how to use the QueueBundleEvent. Is that a plugin or do I have to register the event in the code directly?
That is an internal event of the daemon, which is exposed in the standard logging and available through the event API.
Where is the standard API connection? And what is an extended protocol? Until now, I understand using the tools and have myself made changes to the Ibrdtn C++ tools and I understand workings of ibrdtnd.conf and reading the neighbors via localhost query. However, was curious where/how you got the 'stream' information? Is it the same way we query for the DTN neighbors (say, opening a socket using a python script)?
Extended protocol is the standard API for applications. You use it by connecting with TCP to the daemon on port 4550 and then send the command "protocol extended" to change into that mode. The same way you can switch to other API protocols like "protocol management" and "protocol event". By using the management API you can query the neighbors.
Kind regards, Johannes Morgenroth