I have implemented a UDP listener in Ignition 8.1 scripting that spawns a listener thread using system.util.invokeAsynchronous.
As a test, I create a new socket, bind it to an IP/port, then close it after a time.
When I look in the Gateway/Status/Threads page, the Async thread that is created is disposed of properly after the time elapses.
There is also a “Jython-Netty-Client” thread that is created when the socket bind is called, but this thread persists even though I have disposed of the socket by calling close().
The socket itself seems to close properly after the time as it disappears when I check using netstat from the command line.
The “Jython-Netty-Client” threads seem to persist unless I re-start the gateway. I’m concerned that these will cause a memory leak over time if these threads are accumulating every time I create a socket.
Is there a way to close / dispose of a socket that will also clean up the associated Jython-Netty-Client thread?
Below are the details of a persistent Netty thread:
Thread [Jython-Netty-Client-0] id=383, (RUNNABLE) (native)