GraphStream Users

Archives de la liste Aide


Question about using Netstream


Chronologique Discussions 
  • From: Sean Lynch <lynchseanm AT gmail.com>
  • To: graphstream-users AT litislab.fr
  • Subject: Question about using Netstream
  • Date: Mon, 20 Oct 2014 17:46:46 -0400

Hello GraphStream-users.

I have a question about using a NetStreamReceiver to receive events
from my C++ library (with gs-netstream).

I am using this simple example as a receiver.
https://github.com/graphstream/gs-core/blob/master/src-test/org/graphstream/stream/netstream/ExampleReceiver.java

The problem is that when I open a connection using gs-netstream (c++),
the receiver displays all the events and then closes the socket after
there is no more events. I'd like to have a receiver that stays open
indefinitely. This way I can just run another sender, clearing the
graph and displaying new events. This looks like pipe.pump() closes
the question when there is no more bytes.

If I turn on debugging. It shows me the last messages after
my sender finishes.

[//localhost:2014 | socket from /127.0.0.1:58044 closed]
[//localhost:2014 | removing buffer
sun.nio.ch.SelectionKeyImpl AT 1f4db697
from incoming for getting
inactive. 0 left]

These messages come from the NetStreamReceiver class in the
bufferize() and readDataChunk() functions respectively. I'm not sure
why but after the netstream::NetStreamSender goes out of scope the
buffer is closed. How can I make it so the receiver stays open?

Thank you.

-Sean


  • Question about using Netstream, Sean Lynch, 20/10/2014

Archives gérées par MHonArc 2.6.16.

Top of page