On 12 July 2011 15:17, Schwab,Wilhelm K <[email protected]> wrote: > Rather than changing the handle (making it harder to associate the handle > with the "real" socket), it would be nicer to have a SocketFinalizer or > something - it could even be a subclass of socket?? >
I just thought about it after posting previous mail. Yes it would be nice to add an explicit class, named SocketFinalizer and then add an inst var to Socket - a finalizer. Then when you deleting a socket, a socket could tell a finalizer to nil-out handle, instead of asking WeakRegistry to unregister the socket which is much slower. And a finalization action for nilled out handle will be no-op, once already closed socket become garbage. In that way, someday we could eliminate the #remove: protocol from WeakRegistry. -- Best regards, Igor Stasenko AKA sig.
