[omniORB] RE: omniORB4 on Solaris: clientCallTimeOutPeriod and LOCATION_FOR
WARD
Lai, Patrick
Patrick.Lai@broadvision.com
Wed Dec 18 21:37:01 2002
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C2A6DD.271954F0
Content-Type: text/plain
I think I've found the problem. tcpAddress::Connect() does not check if the connection has indeed been established when select()/poll() suggests that the socket is write-ready. This results in a bogus tcpConnection in the case where a connection to a remote host is refused. The following trace message (level 20?) is the symptom:
omniORB: Client opened connection to giop:tcp:255.255.255.255:65535
The connection status of a socket can be checked by a call to getpeername(). I've enclosed a patch to tcpAddress.cc that adds this call after successful poll()/select().
-- Patrick
> -----Original Message-----
> From: Lai, Patrick
> Sent: Thursday, December 12, 2002 12:58 PM
> To: 'omniorb-list@omniorb-support.com'
> Subject: omniORB4 on Solaris: clientCallTimeOutPeriod and
> LOCATION_FORWARD
>
>
> I'm observing a problem with LOCATION_FORWARD when
> clientCallTimeOutPeriod is non-zero. Here's the scenario:
>
> - Server and client run on different machines.
>
> - Server is launched by an activation agent. (Specifically, I'm using
> Orbix 3.0.1 on the server side; the server is launched by orbixd.)
>
> - omniORB4 client uses an IOR that points to the activation agent.
> The server is not running when the client makes the call.
>
> - When the requests comes to the activation agent, it assigns a port
> for the server, launches it, and replies with LOCATION_FORWARD. Note
> that the server may not be ready when the client starts using the
> forward address.
> ...
------_=_NextPart_000_01C2A6DD.271954F0
Content-Type: application/octet-stream;
name="tcpAddress.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="tcpAddress.patch"
*** tcpAddress.cc.orig Fri Sep 6 14:16:59 2002=0A=
--- tcpAddress.cc Wed Dec 18 13:07:59 2002=0A=
***************=0A=
*** 260,266 ****=0A=
return 0;=0A=
#endif=0A=
}=0A=
! else if (rc =3D=3D RC_SOCKET_ERROR) {=0A=
if (ERRNO =3D=3D RC_EINTR)=0A=
continue;=0A=
else {=0A=
--- 260,272 ----=0A=
return 0;=0A=
#endif=0A=
}=0A=
! if (rc !=3D RC_SOCKET_ERROR) {=0A=
! // Check to make sure that the socket is connected.=0A=
! struct sockaddr_in peer;=0A=
! SOCKNAME_SIZE_T len =3D sizeof(peer);=0A=
! rc =3D getpeername(sock, (struct sockaddr*)&peer, &len);=0A=
! }=0A=
! if (rc =3D=3D RC_SOCKET_ERROR) {=0A=
if (ERRNO =3D=3D RC_EINTR)=0A=
continue;=0A=
else {=0A=
------_=_NextPart_000_01C2A6DD.271954F0--