Hi everyone. I have a small socket problem. I created a client / server app. everything is working fine. but if a client is connected to the server but not send or receive data for a certain period( around 10-15 minutes) the client will not communicate with the server. not sure why?
The server is running on centos
do I need to create a ping system. if yes how often should I ping the server.
Thanks in advance
I think it's an OS problem since the problem does not exists on windows. Only on linux systems. Anyone knows if there is something I should know about TCP sockets on linux?
I already used socket.setKeepAlive(true); but without any luck
It looks like something has to time-out first before the connection setup can be completed and data-transfer can start. Do you connect through a DNS name (like host.company.com) our directly to an IP address?
Gert Jan Kruizinga wrote:It looks like something has to time-out first before the connection setup can be completed and data-transfer can start. Do you connect through a DNS name (like host.company.com) our directly to an IP address?
I connect to an ip address. well after the connection is established everything is working ok. I I will not send any message for 10 -15 minutes it will stop sending messages for 15-20 seconds then it start sending them(so I have a 15-20 seconds lag) . after the lag period it starts sending messages normally and fast. I don't think it's a lag between client and server because I made a test with 100 clients sending a message every 5 seconds and it worked well without lag for 30-40 minutes.
This problem is only on linux. on windows everything is working ok.
I think linux puts the socket in standby until it is reused. do you know anything about this?
I'm not sure it's the code, because this is working great on windows. works great on linux too , until you stop sending information through the socket. after that will have a 20 seconds lag. but all the messages are being sent.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop