ChatProgram not working
Hi. I have made a chat program, and error-handeld every single part of the network-code..(I think).
When i try to test the program on my network, the client connecting the listening-chatprogram, think it is connected,
and the listening chatprogram dont seem to react to the connection...
(yeah, i have tried to turn off the firewall).
I am using Dev-C++, programming for windows.
I have included the source-code so far...
Can anyone see whats wrong? :confused:
The first thing you might try is setting the socket that you accept with WSAAsyncSelect:
I had a problem like this and that solved it for me. Of course, I'm no expert at network programming, but it's worth a try.
clientSocket = accept(listeningSocket, NULL, NULL);
if (WSAAsyncSelect(clientSocket, hwnd, WM_WSAASYNC, FD_CONNECT | FD_WRITE |
FD_READ | FD_CLOSE)!=0) //set up asynchronous sockets
//request WRITE, READ, CONNECT, and CLOSE messages be sent