Home » U++ Library support » U++ Callbacks and Timers » Problem with non-blocking mode
Re: Problem with non-blocking mode [message #23515 is a reply to message #23507] |
Mon, 26 October 2009 00:22  |
rylek
Messages: 79 Registered: November 2005
|
Member |
|
|
Hello there!
As far as I know, in principle there are two basically different ways to make a socket communication run in background. One is to make the sockets non-blocking, the other to run the socket management in a different thread. Moreover, under Windows, the WSA socket management functions let you bind certain socket operation notifications to the message loop and so to avoid polling and emulate the worker thread behaviour in a single-threaded application.
The current socket wrapper in U++ doesn't support this option, mainly because it requires low-level interception of the message queue which would either have to be built into the U++ core (which would be ugly) or would require lots of low-level hackery; moreover it's available in Windows only, Linux has no similar functionality, which makes usability of such feature very limited in a cross-platform environment like U++.
Normally when you open a nonblocking server socket (using the 5-th "is_blocking" argument of the ServerSocket function), calls to Accept fail during the initial client-server handshake and you can use Peek on the server socket to check for pending client connections.
Regards
Tomas
|
|
|
Goto Forum:
Current Time: Tue Aug 26 07:33:13 CEST 2025
Total time taken to generate the page: 0.06798 seconds
|