Is CSocket a blocking socket ?
-
Hello Friends, I am been using CSocket in my application. But i want to know is CSocket a blocing socket or non-blocking socket, and what are the differences between them ?
Girish Software Developer
Girish601 wrote:
But i want to know is CSocket a blocing socket or non-blocking socket, and what are the differences between them ?
CSocket Class MSDN wrote:
A CSocket object also provides blocking, which is essential to the synchronous operation of CArchive. Blocking functions, such as Receive, Send, ReceiveFrom, SendTo, and Accept (all inherited from CAsyncSocket), do not return a WSAEWOULDBLOCK error in CSocket. Instead, these functions wait until the operation completes. Additionally, the original call will terminate with the error WSAEINTR if CancelBlockingCall is called while one of these functions is blocking.
-
Hello Friends, I am been using CSocket in my application. But i want to know is CSocket a blocing socket or non-blocking socket, and what are the differences between them ?
Girish Software Developer
See Windows Sockets: Blocking[^] CSocket is a high-level wrapper for a socket (SOCKET). To you, it's always blocking. Whether the underlying SOCKET is in blocking mode or not is handled by the CSocket implementation. For a non-blocking socket you can use the CAsyncSocket class or use Winsock APIs directly. Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder