I'm trying to create a simple client/server program using UDP on C. I achieved to connect the client with the server and send and recover the data. My question now is how to disconnect the client from server and how server will wait and handle the closing of the connection? I have two methods, Disconnect() on client and Close() on server. In addition, I have a standard output path that need to follow. For example at the beginning need to have :
[Server] - Waiting for connection...[Client] - Opening connection OK
I don't have this result all the time, basically have random place. For example
[Client] - Opening connection [Server] - Waiting for connection...OK
How can I handle this too?
Thanks in advance,