For loop not looping through list of strings?
<p>I'm (trying) to make a little chat prompt, but it's currently not really working as planned.</p>

<pre><code>new Thread(new Runnable(){
        @Override
        public void run(){
            while (true){
                for (Socket s : s){
                    for (String str : receive(s)){
                        System.out.println("processing "+str);
                        if (str.startsWith("#reg")){
                            str = str.replaceAll("#reg", "");
                            registered.put(s.getInetAddress().toString(), str);
                            System.out.println("SERVER &gt;&gt; user "+str+" on "+s.getLocalAddress().toString()+" registered!");
                            send(s, "#confirmed");
                        }else{
                            sendToAll(registered.get(s.getLocalAddress().toString())+" &gt;&gt; "+str);
                        }
                    }
                }
            }
        }
    }).start();
</code></pre>

<p>Right here I'm checking all received messages. They're getting received with this method.</p>

<pre><code>public List&lt;String&gt; receive(Socket s){
    try{
        List&lt;String&gt; lines = new ArrayList&lt;String&gt;();
        InputStream is = s.getInputStream();
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        String line;
        while ((line = br.readLine()) != null) {
            lines.add(line);
            System.out.println("SRECEIVE &gt;&gt; "+line);
        }
        return lines;
    }catch(Exception e){
        e.printStackTrace();
    }
    return null;
}
</code></pre>

<p>which is working, a message with "SRECEIVE >> msg" is popping up in the console.
But the line <code>System.out.println("processing "+str);</code> in the Thread (1st code) isn't popping up.
The variable "s" is an array of (connected) sockets.
The only time "receive(Socket s)" is getting called is in that Thread ^^.</p>