From MAILER-DAEMON Wed Sep 02 08:56:59 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1MipOT-0004ku-LZ
	for mharc-bug-commoncpp@gnu.org; Wed, 02 Sep 2009 08:56:58 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1MhJHJ-0005OA-1L
	for bug-commoncpp@gnu.org; Sat, 29 Aug 2009 04:27:17 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1MhJHI-0005Nl-0b
	for bug-commoncpp@gnu.org; Sat, 29 Aug 2009 04:27:16 -0400
Received: from [199.232.76.173] (port=36366 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1MhJHH-0005Nf-Nr
	for bug-commoncpp@gnu.org; Sat, 29 Aug 2009 04:27:15 -0400
Received: from qw-out-1920.google.com ([74.125.92.146]:37572)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <silence.vincent@gmail.com>) id 1MhJHH-0008Sf-3i
	for bug-commoncpp@gnu.org; Sat, 29 Aug 2009 04:27:15 -0400
Received: by qw-out-1920.google.com with SMTP id 5so945585qwf.24
	for <bug-commoncpp@gnu.org>; Sat, 29 Aug 2009 01:27:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:date:message-id:subject
	:from:to:content-type;
	bh=XmnLkInDpQGDMLaDNptzFAVAaibg7sPNvTOXkYAt8ak=;
	b=nQ6oDobDJMCvPqTRFLD7Ey3UstzQ8/IxkJLC0LhzF0Jt3p08zK390BVc2/evQdNYIS
	rplVZ3yOITcL3x1Besp4QSJyRMHfr2RxJ3yXX5bhzpqbe7aEBIc0Ax1tW7Lm6KZIyuOD
	yQmS3M2wc0ZjXuQFTxqfQrMOhws/BiNJHVUJ4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=GzMS2YbgVXgWsDMJjteytZnewbjbTYJTmWRJoitkiFcQ/axLnPeJfUcpB7vTlpzbyE
	uQcgEVZ4O6jFHVoCHil4XcJIXzhLaCg/eu1pOppc+qw12EhRKpWC9RfSarVgmcqaXcNZ
	/+l+BNUmeRltZuy7dLO2D1LRSMym0fhDj6oHs=
MIME-Version: 1.0
Received: by 10.229.10.214 with SMTP id q22mr1035361qcq.91.1251534433741; Sat, 
	29 Aug 2009 01:27:13 -0700 (PDT)
Date: Sat, 29 Aug 2009 16:27:13 +0800
Message-ID: <d2cf52670908290127hd6df59ai2c10c4edc5d2ea19@mail.gmail.com>
From: Vincent Chen <silence.vincent@gmail.com>
To: bug-commoncpp@gnu.org
Content-Type: multipart/alternative; boundary=0016364ed56e58ebe804724391d1
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Mailman-Approved-At: Wed, 02 Sep 2009 08:56:52 -0400
Subject: TCPtream bug
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 29 Aug 2009 08:27:17 -0000

--0016364ed56e58ebe804724391d1
Content-Type: text/plain; charset=ISO-8859-1

hi,

I recently found TCPStream bug when performing TCPStream::open().
here is my code:

TCPStream client;
client.setTimeout(5000); //this will let connect() function be non-block
while(1)
{
  client.connect(IPV4Host, port, buffer);
  if(!client.isConnected())
  {
    ::usleep(1000000*3);
    continue;
  }
}

Once the first run in connect() failed, it will keep connecting to indicated
IP and port
but the 2nd time it connect, will cause the socket error (I print out the
errno)

I found the socket do not re-initialize when connect() failed.
if add the code in line 3125

 so = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

it will work well

--0016364ed56e58ebe804724391d1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

hi,<br><br>I recently found TCPStream bug when performing TCPStream::open()=
.<br>here is my code:<br><br>TCPStream client;<br>client.setTimeout(5000); =
//this will let connect() function be non-block<br>while(1)<br>{<br>=A0 cli=
ent.connect(IPV4Host, port, buffer);<br>
=A0 if(!client.isConnected())<br>=A0 {<br>=A0=A0=A0 ::usleep(1000000*3);<br=
>=A0=A0=A0 continue;<br>=A0 }<br>}<br><br>Once the first run in connect() f=
ailed, it will keep connecting to indicated IP and port<br>but the 2nd time=
 it connect, will cause the socket error (I print out the errno)<br>
<br>I found the socket do not re-initialize when connect() failed.<br>if ad=
d the code in line 3125<br><br>=A0so =3D socket(AF_INET, SOCK_STREAM, IPPRO=
TO_TCP);<br><br>it will work well<br>

--0016364ed56e58ebe804724391d1--



From MAILER-DAEMON Wed Sep 02 09:24:21 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Mipoz-0004Qk-1Q
	for mharc-bug-commoncpp@gnu.org; Wed, 02 Sep 2009 09:24:21 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Mipox-0004Px-RZ
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 09:24:19 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Mipov-0004Lt-1O
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 09:24:19 -0400
Received: from [199.232.76.173] (port=49600 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Mipou-0004LR-ML
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 09:24:16 -0400
Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:54824)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <dyfet@gnutelephony.org>) id 1Mipou-0007ds-E8
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 09:24:16 -0400
Received: from pool-71-254-55-13.atclnj.east.verizon.net ([71.254.55.13]
	helo=[172.16.59.132])
	by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.68) (envelope-from <dyfet@gnutelephony.org>)
	id 1Mipos-000MBU-QL; Wed, 02 Sep 2009 13:24:14 +0000
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 71.254.55.13
X-Report-Abuse-To: abuse@dyndns.com (see
	http://www.dyndns.com/services/mailhop/outbound_abuse.html for
	abuse reporting information)
X-MHO-User: U2FsdGVkX19uMo2UC5bP38hxNf0qx9Za
Message-ID: <4A9E71FD.2080208@gnutelephony.org>
Date: Wed, 02 Sep 2009 09:24:13 -0400
From: David Sugar <dyfet@gnutelephony.org>
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: Vincent Chen <silence.vincent@gmail.com>
References: <d2cf52670908290127hd6df59ai2c10c4edc5d2ea19@mail.gmail.com>
In-Reply-To: <d2cf52670908290127hd6df59ai2c10c4edc5d2ea19@mail.gmail.com>
X-Enigmail-Version: 0.95.7
Content-Type: multipart/mixed; boundary="------------090704000700020204000804"
X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not
	recognized.
Cc: bug-commoncpp@gnu.org
Subject: Re: TCPtream bug
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Sep 2009 13:24:20 -0000

This is a multi-part message in MIME format.
--------------090704000700020204000804
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Probably instead, connect methods should actually do this if the so is
invalid when they are called.  If we do fail to connect, we should
release the resource as we do now.  If we decide to close/delete the
object on a connect failure, then we would not be waisting resources
acquiring a brand new socket we may never use.  Part of this is also
tied to the use of connect as a constructor method, where the object is
then in a clean state with no socket held if the connect failed at
initialization.  But either way, I will look at resolving this for the
next release.

Vincent Chen wrote:
> hi,
> 
> I recently found TCPStream bug when performing TCPStream::open().
> here is my code:
> 
> TCPStream client;
> client.setTimeout(5000); //this will let connect() function be non-block
> while(1)
> {
>   client.connect(IPV4Host, port, buffer);
>   if(!client.isConnected())
>   {
>     ::usleep(1000000*3);
>     continue;
>   }
> }
> 
> Once the first run in connect() failed, it will keep connecting to
> indicated IP and port
> but the 2nd time it connect, will cause the socket error (I print out
> the errno)
> 
> I found the socket do not re-initialize when connect() failed.
> if add the code in line 3125
> 
>  so = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
> 
> it will work well
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp

--------------090704000700020204000804
Content-Type: text/x-vcard; charset=utf-8;
 name="dyfet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="dyfet.vcf"

begin:vcard
fn:David Sugar
n:Sugar;David
org:GNU Telephony
email;internet:dyfet@gnutelephony.org
tel;work:+1 609 465 5336
url:http://www.gnutelephony.org
version:2.1
end:vcard


--------------090704000700020204000804--



From MAILER-DAEMON Wed Sep 02 11:44:34 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Mis0f-0006nF-PJ
	for mharc-bug-commoncpp@gnu.org; Wed, 02 Sep 2009 11:44:33 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Mis0e-0006mc-65
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 11:44:32 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Mis0d-0006mI-Jv
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 11:44:31 -0400
Received: from [199.232.76.173] (port=33294 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Mis0d-0006mC-8w
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 11:44:31 -0400
Received: from qw-out-1920.google.com ([74.125.92.149]:14514)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <silence.vincent@gmail.com>) id 1Mis0c-0002h4-US
	for bug-commoncpp@gnu.org; Wed, 02 Sep 2009 11:44:31 -0400
Received: by qw-out-1920.google.com with SMTP id 5so506759qwf.24
	for <bug-commoncpp@gnu.org>; Wed, 02 Sep 2009 08:44:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:date:message-id:subject
	:from:to:content-type;
	bh=pUEv5oPeLxik/GKxS0CLiSA3KPsaH6APe1tEksEu5g8=;
	b=M3tnwCwl01r0ubOQXaVB01auUN2Muzk+Hj/j3ZBN/ju5D/T0fmiGB6QwAid9oC/AXb
	lTGK5kQNW1eebFpEziij+Zv2729V72dA81CM/JeS+9zbDzld3/irtDK1sWO0Pgk54J4K
	VtLW3Qy2k8+UIMWik0oWQb4fFhym9UaZBxmLo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=vv8IRJqPdDhx1/o1isLeHaAoluivzzFtIHeoI4yrGY9ULNJ0eXNPiVKGST5QQbIj20
	WembhPgf4CVFZTWJ6n9OHwaJkZ2tbC0lBaaZcub5xFo5UJ9sTMNOfULtkO80LO//QabA
	cRjTle/6wDAjB9arc76HtO8Ou44jgxlfeZHbc=
MIME-Version: 1.0
Received: by 10.229.2.23 with SMTP id 23mr2395734qch.87.1251906269936; Wed, 02 
	Sep 2009 08:44:29 -0700 (PDT)
Date: Wed, 2 Sep 2009 23:44:29 +0800
Message-ID: <d2cf52670909020844p73442d5dgc1e1912656b41dd2@mail.gmail.com>
From: Vincent Chen <silence.vincent@gmail.com>
To: bug-commoncpp@gnu.org
Content-Type: multipart/alternative; boundary=0014853941428308bf04729a24d8
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: URLStream timeout problem
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Sep 2009 15:44:32 -0000

--0014853941428308bf04729a24d8
Content-Type: text/plain; charset=ISO-8859-1

hi,

When I use setTimeout() to URLStream object
it do not performing a non-blocking connect().
Unless I also set TCPStream::timeout be non zero.

in URLStream.hpp line 403

inline void setTimeout(timeout_t to)
{
timeout = to;
TCPStream::timeout = to;
};

The timeout value in URLStream seems only workable for readline().
Could you make it non-blocking in the next release?

thanks

--0014853941428308bf04729a24d8
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

hi,<br><br>When I use setTimeout() to URLStream object<br>it do not perform=
ing a non-blocking connect().<br>Unless I also set TCPStream::timeout be no=
n zero.<br><br>
in URLStream.hpp line 403<br>
=A0=A0 <br>
inline void setTimeout(timeout_t to)<br>
 {<br>
timeout =3D to;<br>
TCPStream::timeout =3D to;<br>
};<br><br>The timeout value in URLStream seems only workable for readline()=
.<br>Could you make it non-blocking in the next release?<br><br>thanks<br>

--0014853941428308bf04729a24d8--



