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

Thanks, I'll dig into the logs. I'd still like to find a way of preventing the client printing those messages, though. For me, it would actually be better if it raised an exception I could trap, though I'm not sure how that works with threaded processes.

On Wed, Jan 10, 2018 at 12:16 AM, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

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.

Ian


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 client.py 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
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

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

_______________________________________________
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



--
Dick Kennedy
Weekly World Inquisitor
www.weeklyworldinquisitor.com

Back to the top