Thomas Chadwick wrote: > I added a printf statement and sure enough, the return value of select > is -1. I then tried printf'ing the value returned by WSAGetLastError. > To make a long story short, I wound up having to comment out the > includes for <sys/types.h> and <sys/time.h> and include > <w32api/winsock.h> instead to get it to succesfully compile x2x.o; and I > had to add -lwsock32 in the Makefile to get it to successfully link > x2x.exe. > > After doing this, select is still non-blocking, returning -1, and the > value returned by WSAGetLastError() is 10038, which seems to correspond > to the #define WSAENOTSOCK in winsock.h. > > Any idea what this error code means and what steps I might take to fix it? >
Thomas, Revert those include and Makefile changes. You do not want to use Winsock, you want to use Cygwin's sockets. Test the rewritten function that I just sent to the list. Harold
