Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Connection reset by peer messages

Hi Dick,

do you have access to the broker log?  If so, there may be some message which indicates why it is disconnecting the client.  I assume that for some reason, the connection to the broker is being broken, and the client is automatically reconnecting.  The broker could be the cause, or it could be elsewhere, but I'd start with the broker.


On 09/01/2018 20:43, Dick Kennedy wrote:
Okay, so I'm a relative newbie - please be gentle.

I'm using paho.mqtt.python. I have a client set up in a Python script with ncurses, and I'm using loop_start() because I'm under the impression that handles sending out ping requests.

Everything is working except for one thing. On occasion there's a message printed to the screen:

[Errno 54] Connection reset by peer

I'm assuming this is some kind of TCP socket error. But the program recovers and carries on working.

Looking at the code, I suspect that what I'm seeing is the output of one of the two print statements in the _packet_read() method. What I'm unsure of is how to deal with this. I could use loop() manually and check for the return value, but I don't think this would prevent that text being printed.
Any suggestions? I guess I could always sub-class and overload this method with a version that doesn't print, but that feels like a last resort!

Dick Kennedy

paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto

Back to the top