[zeromq-dev] C# socket_close Syntax

Martin Sustrik sustrik at 250bpm.com
Mon Nov 7 11:46:18 CET 2011


On 11/07/2011 11:42 AM, Mikko Koppanen wrote:

> as far as I understand majority of the language with GC leave the
> closing to GC. Otherwise this would cause annoying issues where the
> object for the socket is valid but the underlying socket is invalid.
> There should be no need for explicit close as usually object going out
> of scope closes the socket.

It would be more appropriate if the binding developers explain why 
they've added the function, however, my guess is that it's used to close 
the socket immediately, as opposed to leaving it to GC to clean it at 
some later time.

Think of, for exmaple, bound ports. If you close the socket you want the 
port to be available for new sockets immediately rather than lingering on.

Martin



More information about the zeromq-dev mailing list