How to clean up socket connection to printer

loial jldunn2000 at gmail.com
Thu Jul 11 05:28:04 EDT 2013


Replies to questions :

1. Does the printer accept connections again after some time? 

Yes, bit seems to vary how long that takes

2. Does the printer accept connections if you close and re-open the 
Python interpreter?

Not after a Connection reset error. The script exits after trapping the "Connection reset by peer" error and it is only when a new instance of the script is kicked off that the "Connection refused" issue is encountered.
 
3. Is there actually a limit to the number of concurrent connections? In 
other words, what happens when you try to create a second connection 
without closing the first? 

I get the Connction refused error in that scenerio too, but as my script exits after detecting the "Connection reset by peer error" there is only ever one instance of my script running(and therefore one attempt to connect) at a time, Which is why I am wondering whether the connection is closed properly by my code when the script exits afer the "Connection reset by peer" error. Or is it the printer not cleaning up the connection.?






More information about the Python-list mailing list