public void shutdown() {
		shuttingDown = true;
		Logger.log("Shutdown was called.");
		if(ownsSocket) {
			Logger.log("Closing socket.");
			socket.close();
		} else {
			 Logger.log("Note: not closing socket!");
		}
		runningLock.unlock();
	}