private void close () {
        if (handle == null) 
            return;
        
        try {
            handle.close();
            socket.event_closed (endpoint, handle);
        } catch (IOException e) {
            ZError.exc (e);
            socket.event_close_failed (endpoint, ZError.errno());
        }
        handle = null;
    }