[RESOLVED] Winsock Server/Client two way communication
Ok so I've read a ton of tutorials on Winsock and can't wrap my brain around this. What I'm trying to do is create a client server arrangement such that a client connects to the server and sends data to it. Once the server gets that data it sends data back over the same connection.
I want this connection to be used to transmit data in both directions because my client program may be behind a firewall or NAT router and needs to be the one to establish the connection. If the server tries to connect back to the client the connection will fail. Incoming unsolicited connections get dropped.
Where I'm at right now is; the client is able to connect to the server and send it a string of data, such as, "Hello?" The server is able to receieve and process this data. However, I can't figure out how to get the server to transmit a message back to the client, such as, "Who's there?". The message from the server needs to go back out over this same connection and not a new one.
Can anyone show me some basic code or point me to a good tutorial?
Resolved - I put the server's SendData method in the wrong spot :blush: