I have a Problem in my programming in winsock porgramming. In the program, I try to implement communication between a client and a server so I put the functions of server's and client's together. By running two separate processes independently, one play a role as a server and the others as a client. After establishing the connection between them successfully,
the server fail to send the data to the client. However the client can send the data to the server successfully. That make me confused. Hope to get help from anybody who can set it.
The method in my program is as follows:
1 Establishing the server-side socket by running member functions of CAsyncSocket: create(Port) and Listen();
2 Establishing the client-side socket by running member functions of CAsyncSockte: create() and Listen(IPAddr,Port);(Looks successfully by get echo from server's OnAccept() and client's OnConnect() ).
3 Client send data to Server. (No echo from server's OnReceive());
4 Server send data to client. (Get echo from client's OnRecieve() and data).
The step 3 always doesn't work. I don't know why.
Can anybody do me a favor?