public synchronized void close() {
		try {
			if (!isInterrupted())
				interrupt();
		} catch (Exception exc) {
			exc.printStackTrace();
		}
		try {
			if (socket != null)
				socket.close();
		} catch (Exception exc) {
			exc.printStackTrace();
		}
		try {
			if (out != null)
				out.close();
		} catch (Exception exc) {
			exc.printStackTrace();
		}
		try {
			if (in != null)
				in.close();
		} catch (Exception exc) {
			exc.printStackTrace();
		}
		if (this.regLevel != -1) {
			this.regLevel = -1;
			//for (int i = listeners.length - 1; i >= 0; i--)
			//listeners[i].onDisconnected(); 
		}
		socket = null;
		in = null;
		out = null;
	}