Subject: Re: Callback for channel data ready

Re: Callback for channel data ready

From: Tom Weber <tom.weber_at_cryptzone.com>
Date: Mon, 12 Mar 2012 10:58:23 +0100

Another question regarding the channel data queue. Is there a risk that
we could miss incoming data which is received during the query-loop?
Imagine the following situation:

1. poll() indicates POLLIN on the session socket.

2. The application checks channel #1, no data is waiting.

3. The application checks channel #2, no data is waiting, but libssh2
receives data for channel #1.

4. poll() sits around waiting, while we need the channel #1 data to
carry on the conversation.

We have seen delays in traffic now and then, and I wonder if this is the
reason. If so, can you recommend a workaround? Looping one more time
wouldn't change the situation. A dirty workaround I can think of is to
register a snooping recv() callback and keep looping until recv() hasn't
received anything during a loop.

-- 
Best Regards,
Tom Weber
Cryptzone Group AB
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-03-12