INVALID_SOCKET == ~0 (-1),
so NULL != INVALID_SOCKET.
In other words NULL can be correct socket value, but in all program You have:
ASSERT(m_hSocket != NULL); or ASSERT(m_hSocket == NULL);
If I understand well, then function socket() can return correct value 0 (NULL), but then program will give errors.
I don't think, that this situation is possible (in this case), but better replace NULL by INVALID_SOCKET.
Thanks, helped me fix precompiled header compile error C1010
Posted by Legacy
on 05/23/2003 12:00am
Originally posted by:
Thanks, this project showed my how to get CBlockingSocket to compile.
For those who are getting a compile error
"fatal error C1010: unexpected end of file while looking for precompiled header directive"
when trying to compile code using CBlockingSocket, the problem is that as stated in h file:
// needs winsock.h in the precompiled headers
However, it may not be clear how to do this - at least to me it was not. This project showed me how.
1) In Project | Settings choose C++ tab
2) In Category, choose "Precompiled headers"
3) Change "Use precompiled header file (.pch)" radio to "Automatic use of precompiled headers"
I've modified your chess server program to operate strictly as a chat server (I added user name stuff, and connect and disconnect notification), but I want to write an MFC dialog based client. When a message is sent as a big string, as opposed to how the standard windows telnet program does it, the server crashes. How can I modify ReadLine() to accept long strings for messages instead of individual characters (if that is how it works)? If you want to see my code, e-mail me, and I'll send it to you.
Posted by Carlos
on 02/12/2015 08:24am
I read your comment at codeguru.com... would you kindly uppload that chat server you talked about? IÂ´m new at web servers and I need some help to get around a schoolÂ´s task...
Thanks a lot in advance!