public void unregister_endpoints(SocketBase socket_) {
        
        endpoints_sync.lock ();

        try {
            Iterator<Entry<String, Endpoint>> it = endpoints.entrySet().iterator();
            while (it.hasNext()) {
                Entry<String, Endpoint> e = it.next();
                if (e.getValue().socket == socket_) {
                    it.remove();
                    continue;
                }
            }
        } finally {
            endpoints_sync.unlock ();
        }
    }