I am using CSocket to enable a Client and Server to talk to each other. The server blocks on the receive in its own thread, no problem there.
The Client sends to the server but then needs an ACK / NACK from the server to indicate that the message got through OK and that the message was valid. I do not want the client to continue until either the ACK / NACK is received from the server OR the blocking receive times out.
The problem is setting the CSocket::Receive to timeout, as this is a CSocket blocking socket it will not continue until it recieves something from the server, I would like it to timeout and default a NACK allowing the Client to take the appropriate action for a failed send.
I considered the CAsyncSocket for the Client and a while loop to simualte the time out, but I dont think that this is very efficient or the correct way to go.
Any ideas?
Thanks
smpaul
The Client sends to the server but then needs an ACK / NACK from the server to indicate that the message got through OK and that the message was valid. I do not want the client to continue until either the ACK / NACK is received from the server OR the blocking receive times out.
The problem is setting the CSocket::Receive to timeout, as this is a CSocket blocking socket it will not continue until it recieves something from the server, I would like it to timeout and default a NACK allowing the Client to take the appropriate action for a failed send.
I considered the CAsyncSocket for the Client and a while loop to simualte the time out, but I dont think that this is very efficient or the correct way to go.
Any ideas?
Thanks
smpaul