class SocketIoSocket extends Emitter {

    void onClose(String reason) {
        if (mConnected) {
            emit("disconnecting", reason);

            leaveAllRooms();
            mNamespace.remove(this);
            mClient.remove(this);
            mConnected = false;
            mNamespace.removeConnected(this);

            emit("disconnect", reason);
        }
    }

      SocketIoSocket(SocketIoNamespaceImpl namespace, SocketIoClient client);

}