Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Exception: 'NoneType' object has no attribute 'recv'

Hi Adam,

The error you have suggests that your connection is dropping and that is then causing the error in packet_read. It's a bug that that code isn't checking self._sock first.

Are you using client.loop_forever() directly, or client.loop_start() instead? And are you using threads?

Cheers,

Roger


On Mon, Nov 9, 2015 at 1:13 AM, Adam Mills <adam@xxxxxxxxxxxxx> wrote:
Under certain circumstances I get the following exception in loop_forever
I then disconnect, re-create the client and connect and again.
However, it seems the old connection is maintained as i get the constant Connecting/disconnecting that is symptomatic of multiple connections with the same clientid

Unfortunately I can't get the exception to happen locally.
It's running on Python 2.7.3 (OpenWRT) 

Is there any better way to restart after this error?


Exception: 'NoneType' object has no attribute 'recv'
 self.client.loop_forever(retry_first_connection=True)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1261, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 811, in loop
    rc = self.loop_read(max_packets)
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1073, in loop_read
    rc = self._packet_read()
  File "/usr/lib/python2.7/site-packages/paho/mqtt/client.py", line 1407, in _packet_read
    command = self._sock.recv(1)"

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev


Back to the top