Thread: Wsaewouldblock

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    630

    Wsaewouldblock

    Hello..

    I work on a client program that uses select socket model for connections. When I set the socket to nonblocking mode and I want to connect I always get WSAEWOULDBLOCK error. If I try reconnecting I get the same error. What should I do to handle it?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    This is the correct behaviour. WSAWOULDBLOCK isn't really an error, it's telling you that this would block if it was a blocking socket because it is busy doing something. Check your sockt(s) for writability they will be in that state once your connection succeeds.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    630
    I connect the socket, then I wait till its ready to write, and next time I go over the loop to process all the socket I get exception, and if I do WSAGetLastError() I get WSAEWOULDBLOCK.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Post the peice of code that causes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WSAEWOULDBLOCK and WSAEISCONN
    By hardi in forum Networking/Device Communication
    Replies: 1
    Last Post: 12-17-2006, 01:43 PM
  2. Proper way to handle WSAEWOULDBLOCK
    By FMIW in forum Windows Programming
    Replies: 1
    Last Post: 03-18-2002, 10:28 PM