< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] Unexpected TCP connection termination disturbing call setup


Hi Julio,

I think I see the problem - the code in TcpTransport uses getErrno() helper API (which calls WSAGetLastError instead of using the global errno that *nix systems use) and the code in conneciton just uses errno.  Can you please try just changing the following lines in Connection.cxx (near line 168) to use the getErrno() call instead?

If this works for you I will commit this fix.  Thanks for your patience and help in tracking this down.

   int nBytes = write(data.data() + mSendPos,int(data.size() - mSendPos));
   if (nBytes < 0)
   {  
      if (getErrno() != EAGAIN && getErrno() != EWOULDBLOCK) // Treat EGAIN and EWOULDBLOCK as the same: http://stackoverflow.com/questions/7003234/which-systems-define-eagain-and-ewouldblock-as-different-values
      {
         //fail(data.transactionId);
         InfoLog(<< "Write failed on socket: " << this->getSocket() << ", closing connection");
         return -1;
      }
      else
      {
         return 0;
      }
   }

Scott


On Tue, Oct 15, 2013 at 5:14 PM, Julio Cesar Esteves Cabezas <jcabezas@xxxxxxxxxxxxx> wrote:
Hello,

  I obtained a workaround to the problem of TCP connection drops, as
follows:

  - Declared a member mLastErrno, in Connection.hxx
  - Assigned the value obtained by getErrNo() to mLastErrno, in
TcpConnection.cxx
  - Tested mLastErrno (instead of errno) against EAGAIN and EWOULDBLOCK, in
Connection.cxx.

  That worked here, avoiding entering the "if" (as originally intended).
  I'll use this quick fix until an official fix comes in a future revision.

Regards,
Julio.

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/