title: How to get IP address from sockaddr
body: <p>I want to try and get the ip address of a client after calling accept.  This is what I have so far, but I just end up getting some long number that is clearly not an ip address.  What could be wrong?</p>
  
  <pre><code>int tcp_sock = socket(AF_INET, SOCK_STREAM, 0);
  
  sockaddr_in client;
  client.sin_family = AF_INET;
  socklen_t c_len = sizeof(client);
  
  int acc_tcp_sock = accept(tcp_sock, (sockaddr*)&amp;client, &amp;c_len);
  cout &lt;&lt; "Connected to: " &lt;&lt; client.sin_addr.s_addr &lt;&lt; endl;
  </code></pre>