ottowayi / pycomm3

A Python Ethernet/IP library for communicating with Allen-Bradley PLCs.
MIT License
377 stars 88 forks source link

Add ability to set socket connection timeout on CIPDriver #293

Closed tlf30 closed 11 months ago

tlf30 commented 11 months ago

Hello @ottowayi,

I have run into a situation where I need to be able to modify the connection timeout on the CIPDriver socket (thanks to my interns again).

Please review the following changes and let me know what you think.

Example usage:

cip_driver = CIPDriver('192.168.1.25')
cip_driver.socket_timeout = 20
with cip_driver as driver:
   #Do something cool with driver

Thank you, Trevor Flynn