<?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 blocking in socket close in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/blocking-in-socket-close/m-p/3637936#M238677</link>
    <description>Hey all,&lt;BR /&gt;My applications are run on HP 10.20. They are connected Socket.&lt;BR /&gt;when lan cable pull out , the application are hang in close() system call, like this&lt;BR /&gt;&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0  0xc013e920 in _close_sys () from /usr/lib/libc.1&lt;BR /&gt;#1  0xc0149230 in close () from /usr/lib/libc.1&lt;BR /&gt;#2  0x1dcd0 in libSockShutdownSockFd (fd=17) at Sock_socket.c:699&lt;BR /&gt;#3  0x1db80 in libSockClose (fdInfoPtr=0x401502b8) at Sock_socket.c:663&lt;BR /&gt;#4  0x1b8cc in libESockRecvTimerExpired (timerInfo=0x40150a58) at Sock_extern.c:146&lt;BR /&gt;#5  0x1ff00 in libSockChkTimer () at Sock_timer.c:187&lt;BR /&gt;#6  0x196e4 in libSockEventHandler (n=0, rdMask=0x7b03acb0, wrMask=0x7b03adb0, exMask=0x7b03aeb0, timeOut=0x7b03afb0)&lt;BR /&gt;&lt;BR /&gt;As I know, close() returns immediately. But the application is blocking.&lt;BR /&gt;&lt;BR /&gt;I set l_onoff=1, l_linger=0 using setsockopt().&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Sep 2005 04:58:27 GMT</pubDate>
    <dc:creator>???_408</dc:creator>
    <dc:date>2005-09-29T04:58:27Z</dc:date>
    <item>
      <title>blocking in socket close</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocking-in-socket-close/m-p/3637936#M238677</link>
      <description>Hey all,&lt;BR /&gt;My applications are run on HP 10.20. They are connected Socket.&lt;BR /&gt;when lan cable pull out , the application are hang in close() system call, like this&lt;BR /&gt;&lt;BR /&gt;(gdb) where&lt;BR /&gt;#0  0xc013e920 in _close_sys () from /usr/lib/libc.1&lt;BR /&gt;#1  0xc0149230 in close () from /usr/lib/libc.1&lt;BR /&gt;#2  0x1dcd0 in libSockShutdownSockFd (fd=17) at Sock_socket.c:699&lt;BR /&gt;#3  0x1db80 in libSockClose (fdInfoPtr=0x401502b8) at Sock_socket.c:663&lt;BR /&gt;#4  0x1b8cc in libESockRecvTimerExpired (timerInfo=0x40150a58) at Sock_extern.c:146&lt;BR /&gt;#5  0x1ff00 in libSockChkTimer () at Sock_timer.c:187&lt;BR /&gt;#6  0x196e4 in libSockEventHandler (n=0, rdMask=0x7b03acb0, wrMask=0x7b03adb0, exMask=0x7b03aeb0, timeOut=0x7b03afb0)&lt;BR /&gt;&lt;BR /&gt;As I know, close() returns immediately. But the application is blocking.&lt;BR /&gt;&lt;BR /&gt;I set l_onoff=1, l_linger=0 using setsockopt().&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Sep 2005 04:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocking-in-socket-close/m-p/3637936#M238677</guid>
      <dc:creator>???_408</dc:creator>
      <dc:date>2005-09-29T04:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: blocking in socket close</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocking-in-socket-close/m-p/3637937#M238678</link>
      <description>Regardless of blocking or not, setting l_onoff=1 and l_linger=0 is badnews - it can lead to an abortive close of the connection rather than a graceful one.  Abortive closes are bad.&lt;BR /&gt;&lt;BR /&gt;So, instead of setting SO_LINGER, why not leave it unset - l_onoff = 0 and leave it at that.  From the setsockopt manpage:&lt;BR /&gt;&lt;BR /&gt;      SO_LINGER controls the actions to be taken when there are&lt;BR /&gt;      untransmitted data in a SOCK_STREAM send socket buffer when the socket&lt;BR /&gt;      is closed, either due to an explicit call to close() or because the&lt;BR /&gt;      application terminates normally or abnormally.  The action is&lt;BR /&gt;      determined by the values of members of the struct linger data&lt;BR /&gt;      structure pointed to by optval in a call to setsockopt().  The data&lt;BR /&gt;      type struct linger is defined in &lt;SYS&gt;.  If l_onoff is zero&lt;BR /&gt;      (the default action), close() returns immediately, but the system&lt;BR /&gt;      tries to transmit any unsent data and release the protocol connection&lt;BR /&gt;      gracefully.  If l_onoff is non-zero and l_linger is zero, close()&lt;BR /&gt;      returns immediately, any unsent data is discarded, and the protocol&lt;BR /&gt;      connection is aborted.  If both l_onoff and l_linger are non-zero,&lt;BR /&gt;      close() does not return until the system has tried to transmit all&lt;BR /&gt;      unsent data and release the connection gracefully.&lt;/SYS&gt;</description>
      <pubDate>Fri, 30 Sep 2005 11:28:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocking-in-socket-close/m-p/3637937#M238678</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2005-09-30T11:28:14Z</dc:date>
    </item>
  </channel>
</rss>

