I implemented a C ++ project, which: I parse an XML file containing the ip and port of several servers, for each ip and port I first call the connect to server function, in which I connect the TCP sockets to the server, whether the connection is established or not , I make a stream for each ip and port, if the connection is not established, I send the server status that the connection is not established, and if the connection is established, I then make a request to the server and get a response from the server in the stream. This is done after every minute for each thread. Now the problem that I am facing is that if the connection is terminated or the server is powered up, how to make the connection again, which I mean, every one minute before sending a request and receiving a response from the server, I must check if the connection is all there or not. Could you tell me how to do this?
source share