Henri Gomez wrote:

Bill Barker wrote:

----- Original Message -----
From: "Henri Gomez" <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
Sent: Monday, July 12, 2004 3:07 AM
Subject: jk_connect and multi-threading



Hi to all,

I'm looking for a strange problem under iSeries (AS/400) and wonder
about this look in jk_open_socket() (jk_connect.c) :

        do {
            jk_log(l, JK_LOG_DEBUG, "jk_open_socket, try to connect
socket = %d to %s\n",
                   sock, jk_dump_hinfo(addr, buf));

            ret = connect(sock,
                          (struct sockaddr *)addr,
                          sizeof(struct sockaddr_in));
#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
            if(SOCKET_ERROR == ret) {
                errno = WSAGetLastError() - WSABASEERR;
            }
#endif /* WIN32 */
            jk_log(l, JK_LOG_DEBUG, "jk_open_socket, after connect ret
= %d\n", ret);
        } while (-1 == ret && EINTR == errno);


What's the status on errno in multi-threaded environnement ?



On older *nix boxes it wasn't safe to use it with threads. Don't know about
iSeries. On Solaris it's per-thread (assuming that you've compiled
with -D_REENTRANT).



Shouldn't we clear errno before the connect() call ?



It's not supposed to matter.


BTW, I wonder why we check the errno in such case...


Ok, I take a look at IBM errno list and error 3021 is for EINVAL (invalid argument).

I'll investigate this error farther...

The problem could be related to BSD 4.4/Unix 98 where the sa_len should be defined before connect call. May be one of the various reason where
jk_connect failed strangely on many boxes.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to