[Live-devel] TCP connect on non blocking mode

Ross Finlayson finlayson at live555.com
Mon Dec 5 09:41:55 PST 2005


>When "setupStreamSocket" is used to create a TCP socket in a 
>non-blocking mode, it is not possible to make work the "connect" 
>method. We indeed need to wait for a writable event to know when the 
>TCP session is open and therefore when we can write on it.
>I see that you have foreseen the SOCKET_WRITABLE and 
>SOCKET_EXCEPTION in the UsageEnvironment.hh but in 
>"BasicTaskScheduler.cpp", you don't provide any file descriptors to 
>be monitored for these events in the "select" method.
>
>Can you confirm my diagnostic?
>Is it a feature which is not implemented yet ?

That's basically correct, yes.  To date, in my own code, there hasn't 
been a need for 'socket writeable' or 'socket exception' events, 
that's why there's currently no support for enabling/disabling such 
events.  (Note, though, that - as you discovered - 
"UsageEnvironment::BackgroundHandlerProc()" takes an event type 
'mask' parameter, so it could also be used for such events.)

So, if you wanted to, you could define your own subclass of 
"UsageEnvironment" (or "BasicUsageEnvironment") to handle these events.


	Ross Finlayson
	Live Networks, Inc. (LIVE555.COM)
	<http://www.live555.com/>



More information about the live-devel mailing list