public void disconnect() throws IOException {
        if (online == false
//        		|| isConnected() == false
        		) {
            return;
        }
        if (debug > 0)
            error("disconnect()");
        online = false;
        bus.broadcast(new OnlineStatus(false));
        try {
            _in.close();
            _out.close();
//            _telnet.disconnect();
            if(session!=null){
            	session.close();
            }
        	if(conn!=null){
        		conn.close();
        	}
        } catch (Exception e) {
            error("disconnect() - cannot close everything");
        }
    }