pjkundert / cpppo

Communications Protocol Python Parser and Originator -- EtherNet/IP CIP
https://hardconsulting.com/products/6-cpppo-enip-api
Other
332 stars 109 forks source link

Ethernet/IP Client Threadsafe?? #40

Closed nisargpandyadattus closed 6 years ago

nisargpandyadattus commented 6 years ago

Hi, I'm working on CPPPO for the development of EIP Client since quite sometime. I was wandering if it supports threading for reading the client or not? I have created one method which is having host IP, port and list of tags and I'm creating pipeline to read data. Can you please tell me that if the query to the client that is conn.pipeline(operations=client.parse_operations(tags),depth=depth,multiple=multiple,fragment = True, timeout=1.0) can be threaded as I want to query more than one devices over the network together and I'm facing issues in that?

pjkundert commented 6 years ago

Yes, it is thread-safe. Not implemented ideally, to be sure, but it has been used extensively and reliably in multi-threaded Python application environments. See cpppo/server/enip/poll_example_many*.py for examples using the cpppo.server.enip "poll" via "proxy" architecture. The cpppo.server.enip client API is also thread-safe.