Why python raised an AssertionError on some failed assumption in a ZeroMQ client?
Asked Answered
D

0

0

My ZeroMQ server ( not published here, written in java ) is set to run only after triggering an event and the ZeroMQ client ( written in python ) is continuously running in background, waiting for server.

For a considerable time period the python client keeps on running properly and then crashes with this error:

Assertion failed: Connection reset by peer (bundled\zeromq\src\signaler.cpp:298)

It happens when the server is not started for a larger time interval.

The client ( python ) app is in the following form

import zmq

context = zmq.Context()
socket  = context.socket( zmq.REQ )

socket.connect( "tcp://localhost:5555" )

socket.send( b"ReadySIG_From_Python_Emitted" )
message = socket.recv()
print( "OrderDetails %s" % ( message ) )

socket.send( b"TERMINATE" )
exit()
Discoverer answered 22/6, 2016 at 8:24 Comment(3)
Did you look at the log of zeromq server?Podvin
It's hard to say for sure what is going on (do you have a stack trace?) but I would recommend removing the usage of localhost and instead use the numeric address -- see here for more details why.Cords
This code is far from a StackOverflow promoted MCVE method of posting the high quality Questions. Text states (cit.:) "... the ZeroMQ client ... is continuously running in background, waiting for server." Update your Question to contain a fully representative MCVE for both server & client that can reproduce the problem you are reporting and asking the Community to help diagnose and fix. This is the StackOverflow preferred way to constructively solve and discuss any kind of MCVE related issues.Pituitary

© 2022 - 2024 — McMap. All rights reserved.