[zeromq-dev] [routing branch] Re: tcp_socket assertion after client disconnects
Jon Dyte
jon at totient.co.uk
Sat Jun 13 12:07:36 CEST 2009
On Friday 12 Jun 2009, Ferenc Szalai wrote:
> Hi
>
> I just started to play with routing branch. I used the application (zrr,
> zprr) attached to the following mail:
>
> http://lists.zeromq.org/pipermail/zeromq-dev/2009-May/000775.html
>
> The server creates this assertion after one client disconnects:
>
> zrr: tcp_socket.cpp:349: void zmq::tcp_socket_t::blocking_read(void*,
> int): Assertion `n >= 0' failed.
> Aborted
>
> I added the 'always true' error handler to the code:
>
> bool error_handler(const char *s)
> {
> return true;
> }
>
> int main(..)
> set_error_handler(error_handler)
> [...]
>
> but I got the same assertion.
>
> What does this assertion means and how can I keep my server alive after
> one client disconnects?
>
> --
> Regards
> Ferenc
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
Currently the routing branch doesnt handle this, as you see it just asserts.
void zmq::tcp_socket_t::blocking_read (void *data, int size)
{
while (size > 0) {
int n = read (data, size);
assert (n >= 0);
size -= n;
data = (void*) (((unsigned char*) data) + n);
}
}
It looks like the main zmq branch has code to handle disconnection now, so it looks like a merge is in order.
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090613/d43f9f70/attachment.htm>
More information about the zeromq-dev
mailing list