Wsaewouldblock

This is a discussion on Wsaewouldblock within the Networking/Device Communication forums, part of the General Programming Boards category; Hello.. I work on a client program that uses select socket model for connections. When I set the socket to ...

  1. #1
    l2u
    l2u is offline
    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
    l2u
    l2u is offline
    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, 12:43 PM
  2. Proper way to handle WSAEWOULDBLOCK
    By FMIW in forum Windows Programming
    Replies: 1
    Last Post: 03-18-2002, 09:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21