title: in what conditions getpeername returns IP:PORT 0.0.0.0:0
body: <p>in my program I register a EV_READ event for connfd in libevent event loop.
  when this event is triggered, I use <code>getpeername</code> to get the IP/PORT address of the peer</p>
  
  <pre><code>socklen_t socklen;
  struct sockaddr_in client_addr;
  socklen = sizeof(client_addr);
  retval = getpeername(connfd, (struct sockaddr *)&amp;client_addr, &amp;socklen);
  if(retval == -1) perror("getpeername error!\n");
  </code></pre>
  
  <p>but sometimes, it returns 0.0.0.0:0</p>
  
  <p>and then I notice the error is <code>Transport endpoint is not connected</code></p>
  
  <p>but recv(connfd,buf,..) returns a 1273 , which means it receives 1273 bytes.
  if the connection is ended, how can recv() get bytes?
  and how can the event be triggered?</p>
  
  <p>thanks!</p>