AnsweredAssumed Answered

TCP sockets - how do I figure out if the client is still connected?

Question asked by projektecarus on Mar 22, 2013
Latest reply on Mar 26, 2013 by Martin Latal



I am trying to turn a K60f120m board, using CW 10.3 and MQX 3.8, into a TCP server. Most of the basics are already running, however, I have trouble detecting clients that disconnect in an unusual way, for example by removing the ethernet cable. MQX just keeps sending and trying to receive data. At the moment I am using RTCS_ping() as a workaround. If a socket fails to respond too often, I shut it down. This is obviously not a viable long-term solution. Isn't there a more elegant way to detect an inactive client? Isn't TCP supposed to realize if it sends a message that doesn't arrive at the remote socket?


Thanks in advance!