0

ALL, I am looking for a simple example of non-blocking socket connection that will run on Windows. I tried to Google, but all samples are either for *nix (POSIX) or blocking sockets on Windows.

Looking thru msdn I see that it is easy to make a socket non-blocking and issue a connect(), but then you need some preparation in order to put the socket back.

So, all in all I need something on a non-blocking socket that will connect and then put it back to be blocking. The read and write operation should be performed on the blocking socket.

The reason for a non-blocking socket is that I need a connection timeout and there is no other way than non-blocking socket. Or is there?

Thank you.

4

1 回答 1

0

使用ACE 套接字包装外观并充分应用您的 Linux 知识。

于 2012-10-27T13:14:27.063 回答