void onClose ( AbstractSocket socket ) { synchronized ( sockets ) { if ( sockets . remove ( socket . getId ( ) ) == null ) throw new AssertionError ( "Socket not part of this context. onClose called twice?" ) ; } }
Called by a socket when it is closed . This will only be called once .