Thanks. I knew about sleep(); So that actually reduces the CPU cycles. I makes the program wait a few seconds. I get it.


THANKS. I still have some problems where the messages you send to the server overlap with the messages you receive. For example, I am about to send a message. And if the server just sends me a message, it overlaps with the one I was about to send. I guess I should make a variable that will be 1 if I am about to send a message. And while(variable == 1) do not receive. Something like that. Anyone has a better idea?