recv() blocking for non-blocking socket

Omid Roshan-Afshar omid@acorn-networks.com
Mon Sep 10 08:38:00 GMT 2001


I've looked through the archive, and I found
some discussion about using accept() on non-blocking
sockets, but none on recv(). If someone could spot
any stupid errors in the following code, that would
be great.

  {
    int true = 1;
    if (ioctl(sock_handle, FIONBIO, &true) != 0) {
      if (errmsg!=NULL)
        sprintf(errmsg, "ioctl(): %s", strerror(errno));
      return GFAPI_ERR_FAIL;
    }
  }

I call recv after I do this and it blocks. I *think* I'm
doing the appropriate thing to make the socket non-blocking.

cygwin1.dll
  File Version: 1.3.2
  APIVersion: 0.39
  BuildDate: 2001-05-20 23:28




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list