Java multiplayer server blocking io
<p>I am currently developing a prototype for a game and I need a simple server to run it.
At this stage, I don't want to invest the time learning about all the different full-featured multiplayer game servers already there (smartfox, etc...)</p>

<p>I know how to develop a basic Server with Threads listening on Sockets but I have ran into a roadblock. Here's the run() function of the Thread</p>

<pre><code>public void run() {
        try {
            out = new PrintWriter(mSocket1.getOutputStream(), true);
            in = new BufferedReader( new InputStreamReader( mSocket1.getInputStream() ) );
            String inputLine1 = null, outputLine;

            out.println("hello");
            out.flush();

            while( (inputLine1 = in.readLine()) != null) {
                outputLine = mGameControl.processInput(mPlayerNum, inputLine1);
                out.println(outputLine);
                out.flush();
                if(outputLine.contentEquals("bye"))
                    break;
            }

            Terminate();
        }
        catch(IOException e) { e.printStackTrace(); }
    }
</code></pre>

<p>Now my problem is that the thread is blocked waiting for input. I do have other similar Threads connected to other client which may result in information being dispatched to all clients...</p>

<p>How can I modify it so that a different Thread can interact with it and push info to the client?</p>
