TCP Server detect when client disconnects

Für Themen rund um logi.RTS und logi.CAD 3
Post Reply
KristofPauwels
Posts: 2
Joined: 04 Sep 2019, 08:51

TCP Server detect when client disconnects

Post by KristofPauwels »

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.
User avatar
Walter
Official 3rd Party Support logi.cals
Posts: 77
Joined: 15 Dec 2016, 12:56

Re: TCP Server detect when client disconnects

Post by Walter »

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
Post Reply