Server socket timeout : not the exception I would expect

Please post support and help requests here.
Posts: 77
Joined: 03 Dec 2009, 12:55

Server socket timeout : not the exception I would expect

Postby killerbot » 19 Dec 2009, 19:55

I created an application that uses several types of sockets.

1) datagram (broadcast) socket
2) server socket
3) stream socket

Each of those will be dealt with in it's own thread (I manage those threads manually, so no acceptor/reactor pattern).
The thread method tries in case 1) and 3) to receive bytes with a timeout, upon timeout it checks if the application did not request the thread to stop, otherwise it loops back to try to receive bytes, and so on ...
Both these cases throw the 'Poco::TimeoutException' when the timeout occurs. I have specified for both a 'receive timeout'. So this works ok.

However for the ServerSocket (case 2) I try to do the same thing, try to accept with a timeout, and in case of timeout and no application stop was requested loop back and try to accept, ...
The strange thing is : I don't get the TimeOutException (once again I specified a ReceiveTimeOut, is this correct ?) but I get another exception whose displayText is "I/O error: Operation would block".

Anyone any idea of what I am doing wrong, I would have expected also in the ServerSocket case to get TimeOutExceptions.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 5 guests