I am writing a program for a RevolutionPi with Logi.CAD 3 v2.4.0.
In my program I use my RevPi as a TCP server, which waits for a client to connect and than handles on the TCP commands.
The problem I have is that I don't know how to detect when a client disconnects, is there a way to read the TCP flag of the packets we read with the TCP_Receive function.
TCP Server detect when client disconnects
Re: TCP Server detect when client disconnects
Hello Kristof,
after internal clarification I will give you an answer to your question:
Because of the TCP connection timeout of 30 seconds we do not think that it is a good idea to do this check with the tcp commands.
An appropriate way to perform the check would be to implement a kind of continous "ping pong" communication within your PLC code between the server and client.
kind regards
Walter
after internal clarification I will give you an answer to your question:
Because of the TCP connection timeout of 30 seconds we do not think that it is a good idea to do this check with the tcp commands.
An appropriate way to perform the check would be to implement a kind of continous "ping pong" communication within your PLC code between the server and client.
kind regards
Walter