As I was exploring user-lib/pylib, I've seen SocketServer.py containing classes to build a simple server. So I was thinking, maybe it's possible to send network messages (or commands), but I'm not sure how this could work in an existing gateway setup.
So the ignition receive a simple text message from the network but how could we generate an event for the network message? Or would there be another way to hanlde this? I was thinking about a thread running in the background, but I'm not sure if it can be done?
Also, turning ignition into a network client for another process could be interesting, but how to implement a simple query response protocol in ignition?
I did not find documentation on these topics so far, Any help, or links to documentation would be appreciated.
Under no circumstances should you use jython stdlib sockets of any kind. Use java.net or java.nio classes in your scripts.
There is no documentation in Ignition for such things. You would use java examples converted to jython syntax. You would also need to protect yourself from memory leaks due to running old code after project edits, as you generally need long-lived threads to service socket traffic.
The only supported tool along these lines is the Webdev module, but it's specific to HTTP and is "higher level" than e.g. a simple unauthenticated TCP server:
Thank you for your answer, I will read the documentation about long lived thread in ignition.
I figured that it is possible to used java code in ignition, but from a logger(log4j) example found on internet. It works nicely, but I did not understand well how to mix java and cython code. Any documentation on the topic of using java librairies?