title: How do I Send Data to All Threaded Clients in Java?
body: <p>I am fairly new to Java, and I am trying to construct a very basic Java Relay server that sends messages from clients to all connected clients. I have figured out how to do threading to allow multiple connections, but I am having trouble figuring out how to echo an incoming message to ALL connected socket threads.</p>
  
  <p>Here is my Main.java source:</p>
  
  <p><a href="http://pastebin.com/vVewfv3s" rel="nofollow">http://pastebin.com/vVewfv3s</a></p>
  
  <p>Here is my SocketThread.java source:</p>
  
  <p><a href="http://pastebin.com/yHA2BcUi" rel="nofollow">http://pastebin.com/yHA2BcUi</a></p>
  
  <p>Basically, I want to know the easiest way with my current coding setup to be able to send an incoming message from one client to all of the other clients. I am currently using the Windows telnet client as the client working with this server.</p>