Closed GoogleCodeExporter closed 9 years ago
When you reconnect, do you close the socket first?
client.close()
client.connect()
Original comment by Bashw...@gmail.com
on 2 Dec 2012 at 12:03
When you reconnect, do you close the socket first?
Yes.
I also tried to recreate the class:
client.close()
client = ModbusClient(self.host)
client.connect()
Could be that socket.connect returns an invalid value and other than none?
Or "self.socket" is True even before my reconnection?
Nicola.
Original comment by nicola.q...@gmail.com
on 2 Dec 2012 at 6:26
Any chance you could add some logging and see what causes this? I will make
sure to set the socket to None in the exception handler and try and remove any
edge cases, but I would also like to know how you are getting into that
situation.
Original comment by Bashw...@gmail.com
on 17 Dec 2012 at 3:13
Now I set the "standard" logger to warning. Before I used only my personal
logger so the logger of your library was unable to operate.
I found a similar problem after upgrading to Ubuntu 12.04 with an old python
program that uses the library modlib.py of Hynek Petrak.
Probably the problem occurred with the transition from python 2.6 to python 2.7.
I tried to add shutdown(socket.SHUT_RDWR) before close().
Last night I lost the connection at 02:56:58 and resumed at 03:12:41.
Before adding the shutdown() the connection never restored.
Now I waiting for the next few days to see the new logs.
Nicola.
Original comment by nicola.q...@gmail.com
on 18 Dec 2012 at 9:55
I have set log level to warning:
log.setLevel(logging.WARNING)
I lost again the connection for 4 days. None on log. Now I tried to increase
log verbosity to INFO. :(
Nicola.
Original comment by nicola.q...@gmail.com
on 9 Jan 2013 at 11:18
You might want to use DEBUG instead of INFO as that will capture everything.
Original comment by Bashw...@gmail.com
on 13 Jan 2013 at 7:37
Nicola, where you able to find any causes of your error or anything repeatable
that I can work with? I am still glad to add more logging code to the client to
help find a solution.
Original comment by Bashw...@gmail.com
on 19 Jun 2013 at 1:46
Original comment by Bashw...@gmail.com
on 15 Jul 2013 at 5:10
Original issue reported on code.google.com by
nicola.q...@gmail.com
on 1 Dec 2012 at 10:39