title: Server Listening on Multiple Ports [Java]
body: <p>I am trying to figure out how to create a java program that can listen to multiple ports and perform different actions depending on which port the client speaks to.</p>
  
  <p>I've seen and understand the basic client-server program:
  <a href="http://systembash.com/content/a-simple-java-tcp-server-and-tcp-client/" rel="nofollow">http://systembash.com/content/a-simple-java-tcp-server-and-tcp-client/</a></p>
  
  <p>Just to reiterate, I want to create this same relationship, but instead of the server only listening on one port and performing one action when it receives input, I want it to listen on multiple ports and depending which port the client connects and sends data to, perform a different action.</p>
  
  <p>I'm hoping to make each port accept a GET and PUT command in the future, but for now I'm just trying to figure out how to set up the basic structure of the server which will be able to listen to multiple ports. I've tried googling, but I can't seem to find much, so any help is appreciated.</p>
  
  <p>Thanks in advance.
  -Anthony</p>