chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] zmq, problems with using several sockets, closing so


From: Moritz Heidkamp
Subject: Re: [Chicken-users] zmq, problems with using several sockets, closing sockets
Date: Mon, 05 Nov 2012 20:21:55 +0100

Hi Matt,

sorry for responding late, I'm a bit busy these days. However, as the
original author of the zmq egg I feel obliged to chime in :-)

Matt Welland <address@hidden> writes:
> However I need to ping servers to see if they are alive so I wrote a little
> code to try and connect to the server and return yay/nay. The problem I
> have is that if I don't close the socket (I'm pinging a number of servers)
> I get crashes.

That's pretty odd, maybe you're accumulating too many sockets before the
finalizers get a chance to run or something. Could you try to put a call
to (gc #t) into the loop? This should force finalizers to be run. I
would try it myself but your example program seems to have some
dependencies I'm not sure how to satisfy.


> If I do close the socket I get this:
>
> INFO: (0) connected as client
>
> Warning: in finalizer: (close-socket) Socket operation on non-socket:
> 88

I guess this could be considered a bug: The finalizer unconditionally
closes the socket which seems to lead to this error when it was
explicitly closed before. Skimming the API reference I don't see a way
to check whether a socket is already closed. Do you know of any? Or do
you have a better idea how to handle this situation?


Moritz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]