¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

TCP/IP Server stops listening


 

I have a TCP/IP Server on IP address of 0.0.0.0 listening on port 51999 for events from various axis cameras.
After an indeterminate and variable amount of time the Server symbol stops receiving events.
Re-asserting the enable on the Server restores the events until it stops.

Because this is a server, it should sit there waiting for events coming in.
When it is working the events come in fine & status changes from 1 to 2 to 4 and back to 1 as expected.

Anyone have any suggestions as to why this stops working & any work arounds?


 

I have the same issue. I wrote a module that would toggle the connection off and on based on status. Would love to know if there was a better option.


 

In text console type ¡°netstat¡± and you¡¯ll get a dump of connections. Look for your server in the list. You may want ¡°listenstat¡± instead. The point is if you look at the list several times you may see the server socket is opening and closing repeatedly. This will make the Ethernet stack unhappy as the processor has a finite number of sockets available. I know this isn¡¯t a solution, but it may help further diagnose the situation.?


 

What I am hearing here is that the networking stack is underdeveloped and can¡¯t handle multiple successive connections like it should.

We buy Crestron gear for its strengths,

Linux has networking as one of its strengths, and a large amount of public open source code that can train chatgpt4 to spit out decent code

this would be one of those places I¡¯d enlist a low-power Linux machine if I thought limitations of the Crestron processor¡¯s TCP/IP stack were going to break things

To Chatgpt4: ¡°?Write me a Python script that listens for numerous incoming events from diverse sources over tcp 51999 (each event is an incoming connection, then a string, then disconnect) and aggregate these and send them all to a single connection we keep open fulltime to 192.168.22.22 port 51999.¡±

Asking chatgpt4 resulted in a multi-threaded code sample to do exactly this (note: I don¡¯t know if Axis cameras simply drop a string and disconnect or if it uses HTTP for example) but the same basic principle is shown. ?Sample code often comes out 90% correct and you apply your skills to bring it the rest of the way. ?You asked for workarounds.

This could run on a dinrail mount pro-grade raspberrypi or similar, set to autostart on powerup. ?Python will run on anything (Windows, Mac, etc.) so I¡¯d have tested this on a desktop PC first to see if it solved the problem before moving along to dedicating a device to running it.?