<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Duncan,</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 1/22/26 11:12, Duncan Grisby wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:652c1dad31e0dd5b604aa6b86d051d53dc604051.camel@grisby.org"><br>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre"> What's left is to find out, what happens in our case where we get 
</pre>
        <blockquote type="cite">
          <pre wrap="" class="moz-quote-pre">
 omniORB: (199) 2026-01-21 10:04:51.861953: Reset rope addresses
(current address giop:tcp:[::1]:53234)
 omniORB: (199) 2026-01-21 10:04:51.861962: Error in network
receive (start of message): giop:tcp:[::1]:53234
 omniORB: (199) 2026-01-21 10:04:51.861966: throw
giopStream::CommFailure from
giopStream.cc:857(0,MAYBE,COMM_FAILURE_WaitingForReply)
</pre>
        </blockquote>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
Here, the client does not see a CloseConnection message. It just gets a
socket error to say the connection has been closed. I'm not sure why it
did not get the CloseConnection.</pre>
    </blockquote>
    <p>As I wrote in the next mail this difference comes from the fact
      that in our system we use client timeouts everywhere.</p>
    <p>In this case waitRead() is used, and if <span
        style="background-color:#ffffff;padding:0px 0px 0px 2px;"><span
style="color:#000000;background-color:#ffffff;font-family:"Monospace";font-size:11pt;white-space:pre;"><span
        style="color:#b58900;"></span><span style="color:#268bd2;">USE_POLL </span></span></span>is
      set, it will return an error and so that the CloseConnection
      message which</p>
    <p>is still in the buffer is not read. It works fine for me with
      this patch:</p>
    <p>--- snip ---</p>
    <p>Index: include/omniORB4/internal/tcpSocket.h<br>
===================================================================<br>
      --- include/omniORB4/internal/tcpSocket.h    (revision 1135)<br>
      +++ include/omniORB4/internal/tcpSocket.h    (working copy)<br>
      @@ -362,7 +362,7 @@<br>
           int timeout = t.tv_sec*1000+((t.tv_usec+999)/1000);<br>
           if (timeout == 0) timeout = -1;<br>
           rc = poll(&fds, 1, timeout);<br>
      -    if (rc > 0 && fds.revents & POLLERR) {<br>
      +    if (rc > 0 && !(fds.revents & POLLIN)
      && fds.revents & POLLERR) {<br>
             rc = RC_SOCKET_ERROR;<br>
           }<br>
       #else<br>
      --- snip ---</p>
    <p>poll sets here POLLIN and POLLERR, and in the original code, the
      CloseConnection is not read.</p>
    <p>There's possibly a more correct way to adress this but it would
      be nice to process any outstanding data before setting the
      connection to error.</p>
    <p><br>
    </p>
    <p>Anyway I would also like to suggest this additional little patch,
      which would have saved me some time:</p>
    <p>--- snip ---</p>
    <p>Index: src/lib/omniORB/orbcore/giopServer.cc<br>
===================================================================<br>
      --- src/lib/omniORB/orbcore/giopServer.cc    (revision 1135)<br>
      +++ src/lib/omniORB/orbcore/giopServer.cc    (working copy)<br>
      @@ -451,6 +451,12 @@<br>
       <br>
         omni_thread::get_time(deadline, timeout);<br>
       <br>
      +  if (omniORB::trace(25)) {<br>
      +      omniORB::logger log;<br>
      +      log << "server sendCloseConnection: to " <<
      s->connection->peeraddress()<br>
      +      << " 12 bytes\n";<br>
      +    }<br>
      +  <br>
         int tx = s->connection->Send(hdr, 12, deadline);<br>
         if (tx <= 0 && omniORB::trace(25)) {<br>
           omniORB::logger log;<br>
      --- snip ---</p>
    <p>so _all_ CloseConnections are logged. It was a bit confusing to
      find the message in wireshark but not in the logs.</p>
    <p>Greetings,</p>
    <p>  Michael</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>