I have a server.cpp running in background
client.cpp will connect to server and perform its task.
I code the server to listen for connection, while(1), and fork a process for client.
But I have a reminder feature which needs to email customer on a certain time. How do I run that feature together in this server, client cpp file? Should it be run in server or in client file, and in what way? I have tried to fork() at client.cpp but the issue is it cause my client to not work well.
Where should I add this code, and how do i make it work while performing listening to connection at server.cpp?
In server code:
Alternatively, the server can create a seperate thread with this code: