cilu
March 4th, 2004, 09:45 AM
I want to create a server/client application, based on asynchronous communication. I want to use UDP, but TCP would also do.
I wrote some code, but I have a problem. I used TCP and two classes (CServerSocket and CClientSocket) derived from CASyncSocket. Both server and client are on the same machine, but this is irrelevant. I start up the server (Create, Listen and Accept called in OnAccept), connect the client (Create, Connect). Until here everything is ok. The messages from server arrive at the client, but no message is received in server. However when I call Send in CClientSocket it returns the number of bytes of my message, so it produces no error. But on server OnReceive is never called. So, my message is sent by the client, but my server do not detect it.
Does anyone have an idea about what I do wrong?
Some working code, examples, anything would be very welcome.
Thank you.
I wrote some code, but I have a problem. I used TCP and two classes (CServerSocket and CClientSocket) derived from CASyncSocket. Both server and client are on the same machine, but this is irrelevant. I start up the server (Create, Listen and Accept called in OnAccept), connect the client (Create, Connect). Until here everything is ok. The messages from server arrive at the client, but no message is received in server. However when I call Send in CClientSocket it returns the number of bytes of my message, so it produces no error. But on server OnReceive is never called. So, my message is sent by the client, but my server do not detect it.
Does anyone have an idea about what I do wrong?
Some working code, examples, anything would be very welcome.
Thank you.