I have a situation where my c++ application running on the client side and continuously polling the server where my PHP based web applications is running.
The C++ uses LIBCURL and every 5 seconds it polls the server to see if any new data is present in the database. I’m not happy with this idea of continuous polling and I’m concerned about memory leaks since the client side app is running 24/7.
So I was think about implementing a mechanism where the server Will send a message to the client app whenever new Data comes in. The only way I can think of doing this is through sockets. The PHP server will open a socket and send the data to the c++ client who is listening on the socket.
Can anyone kindly give me advise on this method or if there’s a better way to do this.