[gnet-dev] Problem sith socket on windows



Hello,
While in trying to get the echoserver example to run I noticed that the gnet source code looks for socket<0 as an error. The problem is that on windows SOCKET is defined as an unsigned int, and the socket function returns 0 to indicate an error. Because of this gnet does not detect an error in creating sockets. I was wondering what the best way to fix this would be. My thought was to add a
#define INVALID_SOCKET -1
to the unix section gnet-private.h and test for equality. This should work since windows also defines INVLAID_SOCKET. Any comments?

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]