Re: [gnet] gnet 2.0.5 on windows with mingw/msys
- From: "Daniel K. O." <danielosmari yahoo com br>
- To: David Ergo <david ergo alterface com>
- Cc: gnet lists gnetlibrary org
- Subject: Re: [gnet] gnet 2.0.5 on windows with mingw/msys
- Date: Tue, 23 Nov 2004 19:24:24 -0200
David Ergo wrote:
- firstly, SOCKET is defined as an unsigned int under MINGW, so the test
"if (sockfd < 0)", at line 947 of tcp.c, is never true, I replaced it by
"if ((int)sockfd < 0)" (in my case sockfd was -1)
Maybe more corrections of the same type should be done or maybe the
SOCKET type should be corrected in MINGW ?
No, this is the winsock implementation, provided by Microsoft. You could
solve it on MinGW, but this code would still fail in all other Win32
compilers.
The correct way for checking if a socket is valid would be:
if (sockfd == -1) /* this works with an unsigned sockfd, but issues a
warning */
Do the BSD sockets implementations never return sockets bigger than
INT_MAX ? Isn't a socket with a value of -2 valid?
Daniel K. O.
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]