title: How to store each Client (User) connection in Server in Python?
body: <p>I am working on a project it is like a chatting system over TCP/IP. Android users as Clients connect to server, server code is written in Python. I want to explain what actually my problem is clearly. </p>
  
  <p>Say there are two clients (users) A and B. </p>
  
  <p>When Both are connected to server, the sock.accept returns two  soccket connection objects, say "Aconn" and "Bconn".
  like below</p>
  
  <pre><code> Aconn , Aaddress = sock.accept();
  
   Bconn , Baddress = sock.accept();
  </code></pre>
  
  <p>So Now if I want to send a Message from A to B. then Server can forward received message from A to B easily as the object for B is available as "Bconn". we can send the message to B as below.</p>
  
  <pre><code> Bconn.send(datafromA);
  </code></pre>
  
  <p>Problem comes when B is not connected to server yet(Now Offline). B may connect to server in the future(Online). Now how to resolve this issue ? Is it possible to store that socket connection when users connect to  server first time and assigning the same whenever they come online ? Any good solution? Thanks In advance  </p>