Code example for ServerSocket

Methods: accept

     * is a different command that can be run. 
     * @param port the port to listen on 
    private void startServer() throws IOException { 
        clientSocket = serverSocket.accept();
        // At this point, we have a client connected. 
        // Attach the accessibility listeners so that we can start receiving 
        // view events. Do this before wake so we can catch the wake event 
        // if possible. 
        // Wake the device up in preparation for doing some commands. 
        input = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
        // auto-flush 
        output = new PrintWriter(clientSocket.getOutputStream(), true);