Hi!
I'm in troubles to make sockets work when server is sending and receiving data. I need some help
There are two server threads(TS1, TS2) and one client thread (TC).
TS1 does:
- Listen
- loop with:
- Select
- if it's a new client -> Send message to a dialog window
- if it's a known client -> Receive (should receive the "POTATOE" string sent by the client [see below]).
TS2 does:
- Receives the message sent to the dialog window (WM_COMMAND) and calls to Send("INIT")
TC does:
- Receive (and it's blocked until TS2 sends the "INIT" string)
- Send("POTATOE")
Well, the thing is that TC receives the INIT string and sends the POTATOE string to the server, but the server doesn't receive "POTATE" but "INIT" string.
I'm launching server and client application on the same host, but this should not be a problem since server and clients are on different ports.