title: How to get ip address from sock structure in c?
body: <p>I'm writing simple server/client and trying to get client IP address and save it on server side to decide which client should get into critical section. I googled it several times but couldn't find proper way to get IP address from sock structure.</p>
  
  <p>I believe this is a way to get IP from sock struct after server accept request from client. More specifically in c after server execute </p>
  
  <pre><code>csock = accept(ssock, (struct sockaddr *)&amp;client_addr, &amp;clen) 
  </code></pre>
  
  <p>Thanks </p>