troubleshooting Question

Need Kind Help on winsock programming

Avatar of wxhuang
wxhuang asked on
Programming Languages-OtherProgramming
18 Comments1 Solution344 ViewsLast Modified:
Hi,

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?

Thanks

William
 
ASKER CERTIFIED SOLUTION
splat

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros