private void listenToSocket() {
		listeningToSocket = true;
		if (serverSocket != null) {
			Thread t = new Thread("Socket Listener") {
				public void run() {
					while (!stopListening) {
						try {
							readFromSocket();
						}
						catch (Exception e) {
							e.printStackTrace();
							break;
						}
					}
				}
			};
			t.setPriority(Thread.MIN_PRIORITY);
			t.start();
		}
	}