<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
The problem I was having "went away" when I moved to another Solaris 2.6
machine with the latest patch level.
<br>I've also tested it on Solaris 8, HP-UX 11.00 and Linux, so it looks
like there is a connect bug in a release 2.6,
<br>but seems to be fixed with later patches.
<p>Thanks for the help.
<p>Joe
<p>Tom Lane wrote:
<blockquote TYPE=CITE>Joe Murphy <joe(dot)murphy(at)aersoft(dot)ie> writes:
<br>>> The re-connect underlying call to connect returns -1 and errno =
0, so
<br>>> it thinks the connection is "in progress" and tries
<br>>> to complete the connection - but hangs on the select (poll)
<p>Well, you have a bug in connect() if it's returning the wrong errno
<br>in the multi-thread case.
<p>However, our code in fe-connect.c reads like this:
<p> if (connect(conn->sock, &conn->raddr.sa, conn->raddr_len)
< 0)
<br> {
<br> if (SOCK_ERRNO == EINTR)
<br>
/* Interrupted system call - we'll just try again */
<br>
goto retry1;
<p> if (SOCK_ERRNO == EINPROGRESS
|| SOCK_ERRNO == EWOULDBLOCK || SOCK_ERRNO == 0)
<br> {
<br>
/*
<br>
* This is fine - we're in non-blocking mode, and the
<br>
* connection is in progress.
<br>
*/
<br>
conn->status = CONNECTION_STARTED;
<br> }
<br> else
<br> {
<br>
/* Something's gone wrong */
<br>
connectFailureMessage(conn, SOCK_ERRNO);
<br>
goto connect_errReturn;
<br> }
<p>I wonder whether it's really a good idea to treat errno == 0 as
<br>indicating "connection in progress". Does anyone know of a platform
<br>where zero is actually what is returned in this case? The man
pages
<br>I can find all say that EINPROGRESS is returned.
<p>
regards, tom lane
<p>---------------------------(end of broadcast)---------------------------
<br>TIP 4: Don't 'kill -9' the postmaster</blockquote>
<pre>--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Joe Murphy - AerSoft Limited
2 Northumberland Avenue, Dun Laoghaire, Co. Dublin.
phone: +353-1-2301166 direct: +353-1-2145953 fax: +353-1-2301167
<A HREF="mailto:joe(at)aersoft(dot)com">mailto:joe(at)aersoft(dot)com</A> mobile: +353-86-8526181 <A HREF="http://www.aersoft.com">http://www.aersoft.com</A>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</pre>
</html>