Sign in to follow this  

WSAAccept is always blocking

This topic is 4591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I am writing on a TCP class and noticed that even though my stream socket is created with the "Overlapped" option, it blocks when calling WSAAccept. I read the documentation over and over again and put together the following stuff: - WSAEWOULDBLOCK The socket is marked as nonblocking and no connections are present to be accepted. (That is what I expected in the first place) - A socket in nonblocking mode (blocking) fails with the error WSAEWOULDBLOCK when an application calls WSAAccept and no connections are pending on the queue. (Why does it say nonblocking and then blocking ?) - WSA_FLAG_OVERLAPPED This flag causes an overlapped socket to be created. Overlapped sockets can utilize WSASend, WSASendTo, WSARecv, WSARecvFrom, and WSAIoctl (But no WSAAccept ???) Maybe someone can give me some feedback on this. Thanks alot. Lorenz

Share this post


Link to post
Share on other sites
WSA_FLAG_OVERLAPPED refers to overlapped I/O. Only functions that take a WSAOVERLAPPED* parameter can do overlapped I/O.

The overlapped property of a socket is orthogonal to the blocking/non-blocking nature.

Look at AcceptEx, or use ioctlsocket to set it to non-blocking.

Share this post


Link to post
Share on other sites

This topic is 4591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this