public void disconnect() {
		if (socket != null && socket.isConnected() && !socket.isClosed()) {
			if (writer != null) {
				try {
					writer.write(":tmi.twitch.tv QUIT :disconnected");
					writer.newLine();
					writer.flush();
					socket.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			if (receiveThread != null) {
				try {
					receiveThread.join();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				receiveThread = null;
			}
			socket = null;
			writer = null;
			reader = null;
		}
	}