title: Reading data from a python socket received from multiple clients
body: <p>I am writing a python program (master.py) to read the data received from 2 separate clients. This is the code example:</p>
  
  <p>master.py:</p>
  
  <pre><code>data_agg = ''
  HOST = '172.31.31.207'
  PORT = 50008
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.bind((HOST, PORT))
  s.listen(2)
  conn, addr = s.accept()
  print 'Connected by', addr
  while 1:
      data = conn.recv(65535)
      data_agg += data
      if not data: break
  
  data_arr = json.loads(data_agg.decode('utf-8'))
  data_arr = sorted(data_arr)
  print "Sorted attay: \n"
  print data_arr
  </code></pre>
  
  <p>Two clients have the following code:</p>
  
  <pre><code>HOST = '172.31.31.207'
  PORT = 50008
  s0 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s0.connect((HOST, PORT))
  s0.send(sorted_data_string)
  s0.close()
  </code></pre>
  
  <p>However i only receive data from a single client. What would be a proper way to read the data from a socket arriving from multiple receivers? </p>