public void run() {
		System.out.println("Server Starting..") ;
		synchronized(this){
            this.runningThread = Thread.currentThread();
        }

        try {
        	this.serverSocket = new ServerSocket(this.serverPort);
        	System.out.println("Server Started.");
        	System.out.println("This Machine (" + InetAddress.getLocalHost() + ") is now waiting for incomming device connection.");
        } catch (IOException e) {
        	throw new RuntimeException("Cannot open port " + this.serverPort, e);
        }

        while(! isStopped()){
            try {
            	Socket clientSocket = this.serverSocket.accept();
                System.out.println("Client connected through Wifi");

                if (!this.client.isConnected()) {
                	this.client.bind(clientSocket);
                    new Thread(new WorkerRunnable(this.client)).start();
                } else {
                	System.out.println("Client connection has been denied, other device already connected.");
                	clientSocket.close();
                }
            } catch (IOException e) {
                if(isStopped()) {
                    System.out.println("Server Stopped.") ;
                    return;
                }
                throw new RuntimeException("Error accepting client connection", e);
            }
        }
        System.out.println("Server Stopped.") ;
	}