title: How to Process Multiple Requests at the Same Time With a Server
body: <p>Alright, so here's my thinking:</p>
  
  <blockquote>
    <p>If two requests were made to one server at the same time, would one be denied, and if so, how could you keep something like that from happening?</p>
  </blockquote>
  
  <p>I currently have a server set up for a chat application I'm making, and it basically starts a TCP/IP connection, waits for a client, reads the data sent from them, sends something back, disconnects, and repeats. That way, the server never stops running, and as many requests as you want could be made.</p>
  
  <p>However, what if a client was starting up while another program was using the server. If one program was getting a file from the server while the other one was starting up, and the starting up one needed data from the server, but it was already busy, what would happen?</p>
  
  <p>Would the startup wait until the server was available, or would it just go straight to an error (since no connection was available). If so, this could be really bad, since then the user wouldn't have all the data, like the list of his friends, or a few chats. How could you fix this?</p>
  
  <p>My idea would be that you could have a <code>while</code> loop set up so that it keeps queuing the server until it gets a response. Is this the right way to go about this?</p>