omnithread update
Report number 27Reported 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
If you need more information, contact omniorb@uk.research.att.com. We'd like to hear from you.
Contact information
Copyright © 2002 AT&T Laboratories Cambridge
