ATT Labs

AT&T Laboratories
Cambridge

Home page About Us Interactive research Software Opportunities

omnithread update

Report number 27

Reported by Rick H. Wesson

Date 16 Jun 1998

Platforms Solaris 2.6

Version snapshot_980410

Description

With snapshot_980410, Solaris 2.6 clients were throwing COMM_FAILURE because ::recv would return EAGAIN, which omniORB2 does not expect to come from a socket in blocking mode. A bug in the ORB has left the socket in non-blocking mode after connect under certain conditions. This bug only affects snapshot_980410 and only on Solaris.

Patch
The following is a patch (a '}' has been misplaced) that should fix the bug.
tcpSocketMTfactory.cc:

line 794:

#if defined(__sunos__) && defined(__sparc__) && __OSVERSION__ >= 5
  // Use non-blocking connect.
  int fl = O_NONBLOCK;
  if (fcntl(sock,F_SETFL,fl) == RC_SOCKET_ERROR) {
    CLOSESOCKET(sock);
    return RC_INVALID_SOCKET;
  }
  if (connect(sock,(struct sockaddr *)&raddr,
              sizeof(struct sockaddr_in)) == RC_SOCKET_ERROR) 
  {
    if (errno != EINPROGRESS) {
      CLOSESOCKET(sock);
      return RC_INVALID_SOCKET;
    }
    fd_set wrfds;
    FD_ZERO(&wrfds);
    FD_SET(sock,&wrfds);
    struct timeval t = { 30,0 };
    int rc;
    if ((rc = select(sock+1,0,&wrfds,0,&t)) <= 0) {
      // Timeout, do not bother trying again.
      CLOSESOCKET(sock);
      return RC_INVALID_SOCKET;
    }
  }
  // Set the socket back to blocking
  fl = 0;
  if (fcntl(sock,F_SETFL,fl) == RC_SOCKET_ERROR) {
     CLOSESOCKET(sock);
     return RC_INVALID_SOCKET;
  }

#else



Action

[ omniORB main page| Technical details| Performance measurements|
Documentation| Download a free distribution]

If you need more information, contact [email protected]. We'd like to hear from you.

For comments, suggestions and further information please contact us.
Copyright © 2001 AT&T Laboratories Cambridge