<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: getpeername() return 0 but with IP address &amp;quot;0.0.0.0&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817360#M548385</link>
    <description>Actually, the whole structure peerAddr and servAddr are filled with '\0' as if I use memset() to set all bits to 0.</description>
    <pubDate>Wed, 05 Jul 2006 03:01:04 GMT</pubDate>
    <dc:creator>Fei Rao</dc:creator>
    <dc:date>2006-07-05T03:01:04Z</dc:date>
    <item>
      <title>getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817356#M548381</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;The server is listening on a specified port.  When a connection request comes, the server accepts the request and then fork() a child.  Then the server call getpeername() and getsockname() to get the client's and server's addresses.  Unfortunately both two calls succeed and return addresses "0.0.0.0" and ports "0".&lt;BR /&gt;&lt;BR /&gt;I looked up the manual and search through google, but didn't found any solutions.  Do you have any ideas about this problem?&lt;BR /&gt;&lt;BR /&gt;HP-UX B.11.23 9000/800 on PA-RISC&lt;BR /&gt;&lt;BR /&gt;Fei</description>
      <pubDate>Wed, 05 Jul 2006 00:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817356#M548381</guid>
      <dc:creator>Fei Rao</dc:creator>
      <dc:date>2006-07-05T00:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817357#M548382</link>
      <description>Hi Fei, &lt;BR /&gt;&lt;BR /&gt;Check for IPv6 is enabled on your server ? &lt;BR /&gt;&lt;BR /&gt;# ifconfig will show it. &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Wed, 05 Jul 2006 00:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817357#M548382</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-07-05T00:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817358#M548383</link>
      <description>No. Just IPv4.&lt;BR /&gt;&lt;BR /&gt;Here's the source code fragment:&lt;BR /&gt;&lt;BR /&gt;struct sockaddr_in peerAddr, servAddr;&lt;BR /&gt;int addrlen = sizeof (sockaddr_in);&lt;BR /&gt; &lt;BR /&gt;if (-1 == (getpeername(sockFd, (struct sockaddr *)&amp;amp;peerAddr, &amp;amp;addrlen)))&lt;BR /&gt; exitError("getpeername()");&lt;BR /&gt;&lt;BR /&gt;addrlen = sizeof (sockaddr_in); &lt;BR /&gt;if (-1 == (getsockname(sockFd, (struct sockaddr *)&amp;amp;servAddr, &amp;amp;addrlen)))&lt;BR /&gt; exitError("getsockname()");&lt;BR /&gt; &lt;BR /&gt;cout &amp;lt;&amp;lt; "Peer IP: " &amp;lt;&amp;lt; inet_ntoa(peerAddr.sin_addr) &amp;lt;&amp;lt; " PORT: "&amp;lt;&amp;lt; ntohs(peerAddr.sin_port) &amp;lt;&amp;lt; endl; &lt;BR /&gt;&lt;BR /&gt;cout &amp;lt;&amp;lt; "Serv IP: " &amp;lt;&amp;lt; inet_ntoa(servAddr.sin_addr) &amp;lt;&amp;lt; " PORT: " &amp;lt;&amp;lt; ntohs(servAddr.sin_port) &amp;lt;&amp;lt; endl;&lt;BR /&gt;&lt;BR /&gt;Here's the output:&lt;BR /&gt;Peer IP: 0.0.0.0 PORT: 0&lt;BR /&gt;Serv IP: 0.0.0.0 PORT: 0&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Jul 2006 01:20:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817358#M548383</guid>
      <dc:creator>Fei Rao</dc:creator>
      <dc:date>2006-07-05T01:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817359#M548384</link>
      <description>Many many years ago for me, but I guess to remember I used inet_ntoa(peerAddr.sin_addr.s_addr).&lt;BR /&gt;I'm not sure, because I didn't write any C stuff for years.</description>
      <pubDate>Wed, 05 Jul 2006 01:47:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817359#M548384</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2006-07-05T01:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817360#M548385</link>
      <description>Actually, the whole structure peerAddr and servAddr are filled with '\0' as if I use memset() to set all bits to 0.</description>
      <pubDate>Wed, 05 Jul 2006 03:01:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817360#M548385</guid>
      <dc:creator>Fei Rao</dc:creator>
      <dc:date>2006-07-05T03:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: getpeername() return 0 but with IP address "0.0.0.0"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817361#M548386</link>
      <description>A couple things - accept() will also return the remote addressing information, so you can eliminate the per-connection getpeername() call :)&lt;BR /&gt;&lt;BR /&gt;You might consider doing an memset to something other than "0" on the sockaddr so you can see if the calls are setting them to zero or simply not setting them at all.&lt;BR /&gt;&lt;BR /&gt;Also, a tusc trace of the calls might be a good idea.  Make it a verbose one.</description>
      <pubDate>Wed, 05 Jul 2006 19:32:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getpeername-return-0-but-with-ip-address-quot-0-0-0-0-quot/m-p/3817361#M548386</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2006-07-05T19:32:03Z</dc:date>
    </item>
  </channel>
</rss>

