Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 98687 invoked from network); 12 Apr 2006 12:58:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2006 12:58:02 -0000 Received: (qmail 44858 invoked by uid 500); 12 Apr 2006 12:57:50 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 44670 invoked by uid 500); 12 Apr 2006 12:57:49 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 44659 invoked by uid 99); 12 Apr 2006 12:57:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 05:57:49 -0700 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of apr-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 05:57:46 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FTeuG-0002uj-Dl for dev@apr.apache.org; Wed, 12 Apr 2006 14:57:12 +0200 Received: from 81.189.96.46 ([81.189.96.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Apr 2006 14:57:12 +0200 Received: from jakob.praher by 81.189.96.46 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Apr 2006 14:57:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@apr.apache.org From: Jakob Praher Subject: Re: apr_socket_connect Date: Wed, 12 Apr 2006 14:57:08 +0200 Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 81.189.96.46 User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en In-Reply-To: Sender: news X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N hi jeff, Jeff Trawick wrote: > On 4/12/06, Jakob Praher wrote: >>hi all, >> >>apparently I have a strange problem with apr_socket_connect, when >>calling it several times within a short time period, it turns out to >>return APR_SCUCESS without actually succeeded in connect( )ing! > > What socket options have you set on the socket? timeout or just non-blocking? blocking with timeout, the following settings apply: apr_socket_opt_set(mpSocket, APR_TCP_NODELAY, 1); apr_socket_timeout_set(mpSocket, 30*1000000LL ); everything else is as is. > > If you set it to non-blocking, did you wait for the APR_POLLOUT > condition with apr_poll() on the socket before calling > apr_socket_connect again? I think the error from getsockopt() is > reset once it is retrieved the first time. That may be the issue > triggered with calling apr_socket_connect() multiple times. > see above. it is a vanilla blocking socket. > I wouldn't suspect a bug in the kernel for this, or many applications > would fail. > it is interesting though. it boils really down to that, it is due to getsockopt. -- Jakob