Hi thanks for the reply. Unfortunately I have another problem now.
My server only ever receives messages sent to it once the client calls the CloseSocket method.
So this works fine (client code)
Code:
recv(variables); // Receive servers greeting
send(variables); // Send Command
CloseSocket(sock);
However the following doesn't
Code:
recv(variables); // Reveive servers greeting (THIS LINE WORKS)
send(variables) // Send Command (Server does not receive this)
recv(variables) // Wait servers reply (Blocks here)
send(variables) // Reply to server (never executes)
CloseSocket(Sock);
Basically whats happening is the server sends its greeting which is received by the client fine. The client attempts to reply with send but server doesnt receive until client closes socket. Then the client blocks waiting for a reply that wont come.
Sorry for the lack of information as im off out now, if you need more detail i'll post more when i get back.
I think that maybe if i flush the stream after each client "send" command it might work. Is there a flush command for WinSock?
Thanks