title: Finding devices in LAN using a server
body: <p>I am trying to develop a lan chat application. As I looked for the topic, I found that whatsapp, viber etc. use a server which controls all the traffic. The server tells the status of devices and manage all traffic etc. So, what am I trying to know is :</p>
  <blockquote>
  <p>How the server gets the info of devices like, IP address, MAC address etc?</p>
  <p>How the data is transferred from one client to server and then server to another client?</p>
  <p>Which language should I use server side?</p>
  </blockquote>
  <p>As shown in image, I want to connect two devices, A and B and interchange data between them.</p>
  <p><a href="https://i.stack.imgur.com/23FH9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23FH9.png" alt="enter image description here" /></a></p>