<?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 socket recive program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6753582#M494873</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a program but i always run 4 hours and keep loop&lt;/P&gt;&lt;P&gt;program is still alive but the program do nothing,&lt;/P&gt;&lt;P&gt;does any one know how to solve this problem&lt;/P&gt;&lt;P&gt;below is gdb information and source code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int&lt;BR /&gt;CHpuxSocket::readn(int fd, char *buf, unsigned int len)&lt;BR /&gt;{&lt;BR /&gt;//printf("INFO: HpuxSocket::readn\n");&lt;BR /&gt;int cnt;&lt;BR /&gt;int rc;&lt;BR /&gt;cnt = len;&lt;BR /&gt;int counter = 0;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;while (cnt &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;rc = recv(fd,buf,cnt,0);&lt;BR /&gt;//printf("rc=%d\n",rc);&lt;BR /&gt;if (rc &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;if (counter &amp;gt;= 3)&lt;BR /&gt;{&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (errno == EAGAIN)&lt;BR /&gt;{&lt;BR /&gt;counter++;&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (rc == 0)&lt;BR /&gt;return len-cnt;&lt;BR /&gt;buf += rc;&lt;BR /&gt;cnt -= rc;&lt;BR /&gt;}&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;catch (...)&lt;BR /&gt;{&lt;BR /&gt;printf("ERROR: Exception happen\n");&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attaching to program: /usr/local/sbin/ISAgent/isAgent, process 1766&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;0x60000000c040b3f0:0 in _recv_sys+0x30 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(gdb) bt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#0&amp;nbsp; 0x60000000c040b3f0:0 in _recv_sys+0x30 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#1&amp;nbsp; 0x60000000c0420dc0:0 in recv+0x80 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile CHpuxSocket.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#2&amp;nbsp; 0x431c190:0 in CHpuxSocket::readn(int,char*,unsigned int)+0xc0 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#3&amp;nbsp; 0x431b1f0:0 in CHpuxSocket::GetSessionKey(char*,char*)+0x5b0 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmassock.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#4&amp;nbsp; 0x40b4410:0 in irmassock::bAuthenticate()+0x70 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmas.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#5&amp;nbsp; 0x40a92c0:0 in irmas::bConnectToServer(char*,int)+0x180 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#6&amp;nbsp; 0x409e3a0:0 in irmas::bConnectToServer(int)+0x40 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#7&amp;nbsp; 0x40a03c0:0 in irmas::Routine(int)+0x110 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmas_main.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#8&amp;nbsp; 0x409afb0:0 in main+0xa90 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(gdb) &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2015 08:11:34 GMT</pubDate>
    <dc:creator>alert0952</dc:creator>
    <dc:date>2015-06-09T08:11:34Z</dc:date>
    <item>
      <title>socket recive program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6753582#M494873</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a program but i always run 4 hours and keep loop&lt;/P&gt;&lt;P&gt;program is still alive but the program do nothing,&lt;/P&gt;&lt;P&gt;does any one know how to solve this problem&lt;/P&gt;&lt;P&gt;below is gdb information and source code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int&lt;BR /&gt;CHpuxSocket::readn(int fd, char *buf, unsigned int len)&lt;BR /&gt;{&lt;BR /&gt;//printf("INFO: HpuxSocket::readn\n");&lt;BR /&gt;int cnt;&lt;BR /&gt;int rc;&lt;BR /&gt;cnt = len;&lt;BR /&gt;int counter = 0;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;while (cnt &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;rc = recv(fd,buf,cnt,0);&lt;BR /&gt;//printf("rc=%d\n",rc);&lt;BR /&gt;if (rc &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;if (counter &amp;gt;= 3)&lt;BR /&gt;{&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (errno == EAGAIN)&lt;BR /&gt;{&lt;BR /&gt;counter++;&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (rc == 0)&lt;BR /&gt;return len-cnt;&lt;BR /&gt;buf += rc;&lt;BR /&gt;cnt -= rc;&lt;BR /&gt;}&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;catch (...)&lt;BR /&gt;{&lt;BR /&gt;printf("ERROR: Exception happen\n");&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attaching to program: /usr/local/sbin/ISAgent/isAgent, process 1766&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;0x60000000c040b3f0:0 in _recv_sys+0x30 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(gdb) bt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#0&amp;nbsp; 0x60000000c040b3f0:0 in _recv_sys+0x30 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#1&amp;nbsp; 0x60000000c0420dc0:0 in recv+0x80 () from /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile CHpuxSocket.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#2&amp;nbsp; 0x431c190:0 in CHpuxSocket::readn(int,char*,unsigned int)+0xc0 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#3&amp;nbsp; 0x431b1f0:0 in CHpuxSocket::GetSessionKey(char*,char*)+0x5b0 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmassock.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#4&amp;nbsp; 0x40b4410:0 in irmassock::bAuthenticate()+0x70 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmas.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#5&amp;nbsp; 0x40a92c0:0 in irmas::bConnectToServer(char*,int)+0x180 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#6&amp;nbsp; 0x409e3a0:0 in irmas::bConnectToServer(int)+0x40 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#7&amp;nbsp; 0x40a03c0:0 in irmas::Routine(int)+0x110 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;warning: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Use the "objectdir" command to specify the search path for objectfile irmas_main.o.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If NOT specified will behave as a non -g compiled binary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#8&amp;nbsp; 0x409afb0:0 in main+0xa90 ()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(gdb) &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 08:11:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6753582#M494873</guid>
      <dc:creator>alert0952</dc:creator>
      <dc:date>2015-06-09T08:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: socket receive program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6755213#M494874</link>
      <description>&lt;P&gt;&amp;gt;try/catch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is useless if you are just calling libc routines.&amp;nbsp; They don't throw C++ exceptions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#1&amp;nbsp; 0x60000000c0420dc0:0 in recv+0x80 /usr/lib/hpux32/libc.so.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#2&amp;nbsp; 0x431c190:0 in CHpuxSocket::readn(int,char*,unsigned int)+0xc0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The stacktrace just shows you waiting on a socket read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(It also would help if you followed a consistent indentation policy.)&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 17:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6755213#M494874</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2015-06-15T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: socket receive program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6844421#M494875</link>
      <description>&lt;P&gt;Sorry I donot know how to solve this problem with&lt;/P&gt;&lt;P&gt;my problem is hang with recv() os library&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(gdb) where&lt;BR /&gt;#0 0x60000000c037d010:0 in _recv_sys+0x30 () from /usr/lib/hpux32/libc.so.1&lt;BR /&gt;#1 0x60000000c03909b0:0 in recv+0x170 () from /usr/lib/hpux32/libc.so.1&lt;BR /&gt;#2 0x43154c0:0 in CHpuxSocket::readn () at hpux/CHpuxSocket.cpp:271&lt;BR /&gt;#3 0x43147b0:0 in CHpuxSocket::GetSessionKey () at hpux/CHpuxSocket.cpp:357&lt;BR /&gt;#4 0x40b1490:0 in irmassock::bAuthenticate () at irmassock.cpp:223&lt;BR /&gt;#5 0x40a6630:0 in irmas::bConnectToServer () at irmas.cpp:424&lt;BR /&gt;#6 0x409c730:0 in irmas::bConnectToServer () at irmas.cpp:402&lt;BR /&gt;#7 0x409e590:0 in irmas::Routine () at irmas.cpp:1209&lt;BR /&gt;#8 0x40994f0:0 in main () at irmas_main.cpp:344&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is my source code ,how to solve it&lt;/P&gt;&lt;P&gt;int&lt;BR /&gt;CHpuxSocket::readn(int fd, char *buf, unsigned int len)&lt;BR /&gt;{&lt;BR /&gt;//printf("INFO: HpuxSocket::readn\n");&lt;BR /&gt;int cnt;&lt;BR /&gt;int rc;&lt;BR /&gt;cnt = len;&lt;BR /&gt;int counter = 0;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;while (cnt &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;rc = recv(fd,buf,cnt,0);&lt;BR /&gt;//printf("rc=%d\n",rc);&lt;BR /&gt;if (rc &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;if (counter &amp;gt;= 3)&lt;BR /&gt;{&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (errno == EAGAIN)&lt;BR /&gt;{&lt;BR /&gt;counter++;&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;return -1;&lt;BR /&gt;}&lt;BR /&gt;if (rc == 0)&lt;BR /&gt;return len-cnt;&lt;BR /&gt;buf += rc;&lt;BR /&gt;cnt -= rc;&lt;BR /&gt;}&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;catch (...)&lt;BR /&gt;{&lt;BR /&gt;printf("ERROR: Exception happen\n");&lt;BR /&gt;return len;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 05:25:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6844421#M494875</guid>
      <dc:creator>alert0952</dc:creator>
      <dc:date>2016-03-23T05:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: socket receive program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6845337#M494876</link>
      <description>&lt;P&gt;&amp;gt;my problem is hang with recv(2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will hang unless you are in non-blocking mode.&lt;/P&gt;&lt;P&gt;(As I mentioned 9 months ago, remove the try/catch as useless on HP-UX.)&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2016 07:48:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/socket-recive-program/m-p/6845337#M494876</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2016-03-26T07:48:30Z</dc:date>
    </item>
  </channel>
</rss>

