From MAILER-DAEMON Sun Aug 01 08:29:54 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BrFTO-0000mJ-Q2
	for mharc-bug-commoncpp@gnu.org; Sun, 01 Aug 2004 08:29:54 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BrFTN-0000m7-7u
	for bug-commoncpp@gnu.org; Sun, 01 Aug 2004 08:29:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BrFTL-0000kv-F8
	for bug-commoncpp@gnu.org; Sun, 01 Aug 2004 08:29:52 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BrFTL-0000kW-9D
	for bug-commoncpp@gnu.org; Sun, 01 Aug 2004 08:29:51 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BrFP0-0007u6-H5
	for bug-commoncpp@gnu.org; Sun, 01 Aug 2004 08:25:22 -0400
Received: from [192.168.1.100] (pool-138-89-242-104.atc.east.verizon.net
	[138.89.242.104])
	by mail.ostel.com (Postfix) with ESMTP id 290482F2877;
	Sun,  1 Aug 2004 05:28:57 -0700 (PDT)
Message-ID: <410CE130.3000904@ostel.com>
Date: Sun, 01 Aug 2004 08:25:20 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.1 (Macintosh/20040626)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Curtis Magyar <cumagyar@mts.net>
References: <1091237372.8706.20.camel@localhost>	 <410BA958.3090101@ostel.com>
	<1091329189.7875.10.camel@localhost>
In-Reply-To: <1091329189.7875.10.camel@localhost>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: BUG: CommonC++ includes compile time $CFLAGS in ccgnu2-config
 --flags
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: Sun, 01 Aug 2004 12:29:53 -0000

I have already checked in a new branch in cvs, -r stable2, to start 
sorting this and other issues out in for future releases starting with 
1.3....


Curtis Magyar wrote:

>On Sat, 2004-07-31 at 10:14 -0400, David Sugar wrote:
>  
>
>>I believe at the time the intent was to make sure that anything 
>>decendent from common c++ was also compiled with the same options.  This 
>>is important for some options, such as exception handling, but may cause 
>>issues with source build systems for others.  One problem is that a 
>>number of Common C++ specific options detected and set in the configure 
>>script, such as rtti settings, are currently set against CXXFLAGS rather 
>>than something seperate THREAD_FLAGS, and hence would also be lost with 
>>this patch.
>>    
>>
>
>It also seems to break libccext2.pc, because the header directory isn't
>specified.  :(
>
>
>  
>
>>I think the best solution would be to rework the configure tests to 
>>assure those compiler options which are set through tests always do make 
>>it into what ccgnu2-config --flags exports, and those things set by 
>>presetting CFLAGS/CXXFLAGS in front of configure do not.  Since these 
>>tested options are not related to threading itself. they probably should 
>>be represented with COMMMON_FLAGS rather than THREAD_FLAGS, so they are 
>>easier to identify.  Then ccgnu2-config --flags would export the value 
>>of THREAD_FLAGS & COMMON_FLAGS rather than THREAD_FLAGS & CXXFLAGS as it 
>>does now.
>>    
>>
>
>I spent some time playing with the configure.in last night.  I'll
>explore some more, and familiarize with the m4 stuff.  Hopefully I can
>be of some help in straightening this out.
>
>--
>Curtis Magyar
>
>
>  
>



From MAILER-DAEMON Wed Aug 04 08:51:48 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BsLFE-0001ZF-BJ
	for mharc-bug-commoncpp@gnu.org; Wed, 04 Aug 2004 08:51:48 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BsLFD-0001Z5-8n
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 08:51:47 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BsLFB-0001YA-2z
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 08:51:46 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BsLFA-0001Xi-Pl
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 08:51:44 -0400
Received: from [195.41.178.3] (helo=proinfo.dk)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BsLBH-0004Ks-VI
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 08:47:44 -0400
Received: from mars.prointra.dk ([148.170.19.5]) by gate1.proinfo.dk with
	ESMTP id <334204>; Wed, 4 Aug 2004 14:47:24 +0200
Received: by mars.prointra.dk with Internet Mail Service (5.5.2650.21)
	id <QGA5BH1W>; Wed, 4 Aug 2004 14:47:38 +0200
Message-ID: <CC2F8BD52F20D41184D40040C77A41A101DFFA51@mars.prointra.dk>
From: Byrial Jensen <bje@prosafe.as>
To: bug-commoncpp@gnu.org
Date: Wed, 4 Aug 2004 14:47:37 +0200 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain; charset="iso-8859-1"
Subject: Why is Thread::terminate() protected?
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, 04 Aug 2004 12:51:47 -0000

Hallo,

I am using threads in CommonC++ and have a situation
where I want one thread to create another thread and
later terminate it again. I thougt it would be possible
to do it as outlined in the example code below:

class MyThread : public Thread
{
public:
	MyThread () {};
	virtual ~MyThread () { terminate (); };

protected:
	virtual void run ()
	{
		while (1)
		{
			setCancel (cancelImmediate);
			do_something ();
			setCancel (cancelDeferred);
			do_something_else ();
			testCancel ();
		};
	};

	virtual void final () { delete this; };
};

int main ()
{
	MyThread *mt = new MyThread ();
	mt->start ();
	wait_for_something ();
	mt->terminate ();
	wait_again ();
	return 0;
}

However, that does not work because Thread::terminate() is
declared protected. Neither can I just delete my MyThread
object because then I cannot control that it does not happen
while cancellation is deferred.

Would it do any harm just to declare Thread::terminate()
public, or is there another preferred way to do what I
intend to do?

Thank you for your help.

Best regards
Byrial Jensen



From MAILER-DAEMON Wed Aug 04 12:12:39 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BsONb-0006lg-3q
	for mharc-bug-commoncpp@gnu.org; Wed, 04 Aug 2004 12:12:39 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BsONa-0006lb-8p
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 12:12:38 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BsONZ-0006lI-N0
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 12:12:37 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BsONZ-0006lF-Ju
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 12:12:37 -0400
Received: from [142.161.130.102] (helo=mx-mtaout02.mts.net)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BsOJd-0006IQ-I0
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 12:08:33 -0400
Received: from curtman.magyar ([142.161.35.203]) by mx-mtaout02.mts.net
	with ESMTP
	id <20040804160832.BKBB1684.mx-mtaout02.mts.net@curtman.magyar>;
	Wed, 4 Aug 2004 11:08:32 -0500
From: Curtis Magyar <cumagyar@mts.net>
To: bug-commoncpp@gnu.org
In-Reply-To: <CC2F8BD52F20D41184D40040C77A41A101DFFA51@mars.prointra.dk>
References: <CC2F8BD52F20D41184D40040C77A41A101DFFA51@mars.prointra.dk>
Content-Type: multipart/mixed; boundary="=-3vE7L4r/i2tuFzaqVXGI"
Date: Wed, 04 Aug 2004 11:09:27 -0500
Message-Id: <1091635768.8241.38.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 1.5.90 
Cc: Byrial Jensen <bje@prosafe.as>
Subject: Re: Why is Thread::terminate() protected?
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, 04 Aug 2004 16:12:38 -0000


--=-3vE7L4r/i2tuFzaqVXGI
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Wed, 2004-08-04 at 14:47 +0200, Byrial Jensen wrote:
> Hallo,
> 
> I am using threads in CommonC++ and have a situation
> where I want one thread to create another thread and
> later terminate it again. I thougt it would be possible
> to do it as outlined in the example code below:

I generally haven't had very much luck doing what you're trying to do.
I've attached a runnable test app based on your code that works more
like the approach I've had great success with.

--
Curtis Magyar

--=-3vE7L4r/i2tuFzaqVXGI
Content-Description: 
Content-Disposition: inline; filename=test.cc
Content-Type: text/x-c++src; charset=UTF-8
Content-Transfer-Encoding: 7bit

#include <cc++/thread.h>
#include <iostream>
#include <unistd.h>
#include <termios.h>

using ost::Thread;
using namespace std;

void wait_for_something ();

class MyThread : public Thread
{
private:
        bool    exitflag;

public:
        MyThread () : exitflag(false) 
                 {};
            
        virtual ~MyThread ()
                 {}; 
        
        void    quit     (void)
                 {exitflag = true;}
        
        bool    isrunning(void)
                 {return (!exitflag);}
        
protected:
        virtual void run ()
        {
                while (!exitflag)
                {
                        do_something ();
                        do_something_else ();
                };
            // Do something here on the way out if you like.
        };
        
        void    do_something()
                    {   cout << "Doing something \t... " << flush;
                        Thread::sleep(2*1000);
                        cout << "Done something" << endl; 
                    };
        
        void do_something_else ()
                    {   if (exitflag) return;
                        cout << "Doing something else \t... " << flush;
                        Thread::sleep(3*1000);
                        cout << "Done something else" << endl;
                        };
};

int main ()
{
        MyThread *mt = new MyThread ();
        mt->start ();
        wait_for_something ();
        mt->quit ();
        while (mt->isrunning()) {
            sleep(1);
            }
        delete (mt);
        return 0;
}

void wait_for_something () {
    struct termios      newtios,
                        oldtios;
    bool                exitflag    = false;
    char                key         = 0;
    
    tcgetattr(STDIN_FILENO, &oldtios);
    newtios = oldtios;
    newtios.c_lflag &= ~ICANON;
    tcsetattr(STDIN_FILENO, TCSANOW, &newtios);
    
    cout << "Press Q to quit." << endl;
    
    while (!exitflag) {
        read(STDIN_FILENO, &key, 1);
        if (toupper(key) == 'Q') {
            exitflag = true;
            }
        usleep (500);
        }
    
    cout << "\nExiting" << endl;
    tcsetattr(STDIN_FILENO, TCSANOW, &oldtios);
    }

--=-3vE7L4r/i2tuFzaqVXGI--




From MAILER-DAEMON Wed Aug 04 14:14:08 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BsQH9-0002Ix-VY
	for mharc-bug-commoncpp@gnu.org; Wed, 04 Aug 2004 14:14:08 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BsQH8-0002Is-KS
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 14:14:06 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BsQH8-0002Ig-1r
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 14:14:06 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BsQH7-0002IW-Ug
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 14:14:06 -0400
Received: from [65.203.76.4] (helo=notes.colorspan.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BsQDK-0005bi-Ra
	for bug-commoncpp@gnu.org; Wed, 04 Aug 2004 14:10:11 -0400
To: bug-commoncpp@gnu.org
MIME-Version: 1.0
X-Mailer: Lotus Notes Release 5.0.9a  January 7, 2002
Message-ID: <OFDE22A342.6247A746-ON86256EE6.0062D4D5-86256EE6.00640CCF@colorspan.com>
From: Dan.Nelson@colorspan.com
Date: Wed, 4 Aug 2004 13:13:53 -0500
X-MIMETrack: Serialize by Router on MN_Notes1/Colorspan(Release 5.0.12
	|February 13, 2003) at 08/04/2004 01:14:13 PM,
	Serialize complete at 08/04/2004 01:14:13 PM
Content-Type: multipart/alternative;
	boundary="=_alternative 00640CC686256EE6_="
Subject: TCPStream 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, 04 Aug 2004 18:14:06 -0000

This is a multipart message in MIME format.
--=_alternative 00640CC686256EE6_=
Content-Type: text/plain; charset="us-ascii"

Hi,

I'm having a problem with the TCPStream class I'm hoping someone can help 
with...I'm working on the Win32 platform with Visual Studio 6, with 6 or 7 
modules using TCPStreams to talk to each other.  Under normal conditions, 
things seem to work properly.  Under one recently-identified and 
repeatable circumstance, a heavy load is applied so that a lot of data is 
flowing both ways through the TCPStream and data suddenly stops flowing 
BOTH ways.  The data is divided into "messages" separated by calls to 
TCPStream::overflow() to ensure each message goes through the connection 
in a timely fashion.

This happens both when the modules are compiled as release services or as 
debug console applications.  When I break in the debugger, I find that 
BOTH modules in the test are blocking at the exact same position (though 
not always on the exact same message), at the call to 
TCPStream::overflow(), and they're both blocking on the ::send() call. The 
parameters both sides are trying to use with send() look like valid 
values.

I noticed at this point that there is a special-case in 
TCPStream::overflow() for a buffer of size 1 (I was using first size 10 * 
1024 and then 50 * 1024), so I reset things to try to exercise the 
special-case.  I had the same result except the deadlock seemed to happen 
with fewer messages making it successfully through the connection.

I originally was working with CommonCPP2 version 1.0.8 when I hit this 
problem.  Upgrading to version 1.1.8 yesterday and this morning yields the 
same result.

I would supply sample code, but couldn't figure out a way to simplify the 
problem into a reproduceable example.  Any ideas on whether I should try 
varying configuration settings would be very welcome.

Thanks,
Dan
--=_alternative 00640CC686256EE6_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I'm having a problem with the TCPStream class I'm hoping someone can help with...I'm working on the Win32 platform with Visual Studio 6, with 6 or 7 modules using TCPStreams to talk to each other. &nbsp;Under normal conditions, things seem to work properly. &nbsp;Under one recently-identified and repeatable circumstance, a heavy load is applied so that a lot of data is flowing both ways through the TCPStream and data suddenly stops flowing BOTH ways. &nbsp;The data is divided into &quot;messages&quot; separated by calls to TCPStream::overflow() to ensure each message goes through the connection in a timely fashion.</font>
<br>
<br><font size=2 face="sans-serif">This happens both when the modules are compiled as release services or as debug console applications. &nbsp;When I break in the debugger, I find that BOTH modules in the test are blocking at the exact same position (though not always on the exact same message), at the call to TCPStream::overflow(), and they're both blocking on the ::send() call. &nbsp;The parameters both sides are trying to use with send() look like valid values.</font>
<br>
<br><font size=2 face="sans-serif">I noticed at this point that there is a special-case in TCPStream::overflow() for a buffer of size 1 (I was using first size 10 * 1024 and then 50 * 1024), so I reset things to try to exercise the special-case. &nbsp;I had the same result except the deadlock seemed to happen with fewer messages making it successfully through the connection.</font>
<br>
<br><font size=2 face="sans-serif">I originally was working with CommonCPP2 version 1.0.8 when I hit this problem. &nbsp;Upgrading to version 1.1.8 yesterday and this morning yields the same result.</font>
<br>
<br><font size=2 face="sans-serif">I would supply sample code, but couldn't figure out a way to simplify the problem into a reproduceable example. &nbsp;Any ideas on whether I should try varying configuration settings would be very welcome.</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Dan</font>
--=_alternative 00640CC686256EE6_=--



From MAILER-DAEMON Thu Aug 05 03:18:20 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BscW4-00030d-Ih
	for mharc-bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:18:20 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BscW3-00030S-Cx
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:18:19 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BscW2-000309-NN
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:18:19 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BscW2-000306-KH
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:18:18 -0400
Received: from [195.41.178.3] (helo=proinfo.dk)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BscRz-0004pV-45
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:14:07 -0400
Received: from mars.prointra.dk ([148.170.19.5]) by gate1.proinfo.dk with
	ESMTP id <334307>; Thu, 5 Aug 2004 09:13:59 +0200
Received: by mars.prointra.dk with Internet Mail Service (5.5.2650.21)
	id <QGA5B2JR>; Thu, 5 Aug 2004 09:14:05 +0200
Message-ID: <CC2F8BD52F20D41184D40040C77A41A101DFFA52@mars.prointra.dk>
From: Byrial Jensen <bje@prosafe.as>
To: bug-commoncpp@gnu.org
Date: Thu, 5 Aug 2004 09:14:05 +0200 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain; charset="iso-8859-1"
Subject: Re: Why is Thread::terminate() protected?
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: Thu, 05 Aug 2004 07:18:19 -0000

Curtis Magyar wrote:
> On Wed, 2004-08-04 at 14:47 +0200, Byrial Jensen wrote:
>> Hallo,
>> 
>> I am using threads in CommonC++ and have a situation
>> where I want one thread to create another thread and
>> later terminate it again. I thougt it would be possible
>> to do it as outlined in the example code below:
> 
> I generally haven't had very much luck doing what you're trying to do.
> I've attached a runnable test app based on your code that works more
> like the approach I've had great success with.

Thank you,

Unfortunately I cannot use your approach where the thread to
be deleted checks a delete-flag at appropiate times, because
my threads to be terminated are instances of class TCPSocket,
and they are blocked in a SocketPort constructor doing a accept(2)
system call when I want them to terminate (and release their sockets).
Therefore I need to be able to terminate them from another thread.

I still wonder why Thread::terminate() is protected. The manual
says: "Used by another thread to terminate the current thread."
 - how should that be done when the function is not public?

Best regards,
Byrial Jensen



From MAILER-DAEMON Thu Aug 05 03:49:20 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1Bsd03-0000m1-TM
	for mharc-bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:49:19 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1Bsd03-0000lw-3k
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:49:19 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1Bsd00-0000lk-7Q
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:49:18 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1Bsd00-0000lh-47
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:49:16 -0400
Received: from [194.7.105.76] (helo=smtp2.agfa.be)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bscw9-000050-QI
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 03:45:18 -0400
Received: from agbi0037.agfa.be (bemordsmt01.agfa.be [10.232.8.46])
	by smtp2.agfa.be (8.11.7p1+Sun/8.11.7) with ESMTP id i757iSY10768
	for <bug-commoncpp@gnu.org>; Thu, 5 Aug 2004 09:44:28 +0200 (MEST)
To: bug-commoncpp <bug-commoncpp@gnu.org>
Message-ID: <OF83CC3CA0.F7DD1DD3-ONC1256EE7.002A7BD1-C1256EE7.002A96C8@agfa.com>
From: Keith Thornton <keith.thornton@agfa.com>
Date: Thu, 5 Aug 2004 09:45:11 +0200
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Subject: Re: Why is Thread::terminate() protected?
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: Thu, 05 Aug 2004 07:49:19 -0000





I asked myself the same question because in the QpThread library, this
method is public and works perfectly well.




From MAILER-DAEMON Thu Aug 05 04:58:19 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1Bse4o-0004Vn-KR
	for mharc-bug-commoncpp@gnu.org; Thu, 05 Aug 2004 04:58:18 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1Bse4l-0004Vf-TY
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 04:58:16 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1Bse4j-0004VS-Sk
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 04:58:14 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1Bse4j-0004VP-Gk
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 04:58:13 -0400
Received: from [195.112.37.194] (helo=jolt.ukmail.org)
	by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168)
	(Exim 4.34) id 1Bse17-0007y0-Rn
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 04:54:30 -0400
Received: from jolt.ukmail.org ([127.0.0.1] helo=acid)
	by jolt.ukmail.org with smtp (Exim 3.35 #1 (Debian))
	id 1Bse0z-0007ED-00; Thu, 05 Aug 2004 09:54:21 +0100
Message-ID: <002d01c47ac9$d90587d0$147ba8c0@acid>
From: "Nick Liebmann" <nick@ukmail.org>
To: "Byrial Jensen" <bje@prosafe.as>,
	<bug-commoncpp@gnu.org>
References: <CC2F8BD52F20D41184D40040C77A41A101DFFA51@mars.prointra.dk>
Date: Thu, 5 Aug 2004 09:54:35 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Cc: 
Subject: Re: Why is Thread::terminate() protected?
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: Thu, 05 Aug 2004 08:58:16 -0000

Hi,

Could you not just write your own member function in your derived class?

public:
void do_terminate()
{
    terminate();
}

which you call instead of terminate() from outside.

regards

Nick

Byrial Jensen wrote:
> Hallo,
> 
> I am using threads in CommonC++ and have a situation
> where I want one thread to create another thread and
> later terminate it again. I thougt it would be possible
> to do it as outlined in the example code below:
> 
> class MyThread : public Thread
> {
> public:
> MyThread () {};
> virtual ~MyThread () { terminate (); };
> 
> protected:
> virtual void run ()
> {
> while (1)
> {
> setCancel (cancelImmediate);
> do_something ();
> setCancel (cancelDeferred);
> do_something_else ();
> testCancel ();
> };
> };
> 
> virtual void final () { delete this; };
> };
> 
> int main ()
> {
> MyThread *mt = new MyThread ();
> mt->start ();
> wait_for_something ();
> mt->terminate ();
> wait_again ();
> return 0;
> }
> 
> However, that does not work because Thread::terminate() is
> declared protected. Neither can I just delete my MyThread
> object because then I cannot control that it does not happen
> while cancellation is deferred.
> 
> Would it do any harm just to declare Thread::terminate()
> public, or is there another preferred way to do what I
> intend to do?
> 
> Thank you for your help.
> 
> Best regards
> Byrial Jensen
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp





From MAILER-DAEMON Thu Aug 05 05:12:29 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BseIX-0007SO-Mp
	for mharc-bug-commoncpp@gnu.org; Thu, 05 Aug 2004 05:12:29 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BseIU-0007Qt-8b
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 05:12:26 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BseIT-0007Qc-FS
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 05:12:25 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BseIT-0007QL-Ak
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 05:12:25 -0400
Received: from [128.87.251.113] (helo=smtpoutuk02.marconi.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BseEL-00016S-JJ
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 05:08:10 -0400
Received: from cvdgwy01.uk.marconicomms.com (cvis26.uk.marconicomms.com
	[128.87.251.109])
	by smtpoutuk02.marconi.com (8.12.11/8.12.11) with ESMTP id
	i758tr7J020628
	for <bug-commoncpp@gnu.org>; Thu, 5 Aug 2004 09:55:59 +0100
	(envelope-from Georg.Soffel@marconi.com)
To: bug-commoncpp@gnu.org
X-Mailer: Lotus Notes Release 5.0.8  June 18, 2001
Message-ID: <OFF9C69E62.A9143AF3-ONC1256EE7.00308258@uk.marconicomms.com>
From: "Georg Soffel" <Georg.Soffel@marconi.com>
Date: Thu, 5 Aug 2004 11:07:53 +0200
X-MIMETrack: Serialize by Router on CVDGWY01/S/EXT/MC1(5012HF354 | August 26,
	2003) at 05/08/2004 10:07:58
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
Subject: patches to remove compiler warnings
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: Thu, 05 Aug 2004 09:12:26 -0000

Dear all,

part of our code quality policy is to switch on as much compiler warnings
as possible.
In doing so I get unnecessary warnings from commoncpp:

/usr/local/include/cc++2/cc++/thread.h:499:7: warning: "HAVE_ATOMIC" is not
defined

/usr/local/include/cc++2/cc++/socket.h:1163: warning: unused parameter
`const ost::IPV4Host&ia'

/usr/local/include/cc++2/cc++/socket.h:1163: warning: unused parameter
`tpport_t port'

/usr/local/include/cc++2/cc++/socket.h:1562: warning: base class `
   struct std::basic_ios<char, std::char_traits<char> >' should be
explicitly
   initialized in the copy constructor
[this one here is special, I think it has nothing to do with commoncpp
itself, but is a problem the compiler (currently: gcc (GCC) 3.3)]

To get rid off all these warning here are the patches against
commoncpp2-1.2.4:

###### patch for thread.h #### cut here ######
--- thread_orig.h       Thu Aug  5 10:08:29 2004
+++ thread.h    Thu Aug  5 10:19:13 2004
@@ -496,7 +496,7 @@
 private:
 #ifdef HAVE_ATOMIC_AIX
        volatile int counter;
-#elif  HAVE_ATOMIC
+#elif  defined HAVE_ATOMIC
        atomic_t atomic;
 #else
        volatile int counter;
###### patch for thread.h #### cut here ######


###### patch for socket.h #### cut here ######
--- socket_orig.h       Thu Aug  5 10:21:12 2004
+++ socket.h    Thu Aug  5 10:24:25 2004
@@ -1159,7 +1159,7 @@
         * @param ia internet host address of the client.
         * @param port number of the client.
         */
-       virtual bool onAccept(const IPV4Host &ia, tpport_t port)
+       virtual bool onAccept(const IPV4Host &, tpport_t)
                {return true;}

        friend class TCPStream;
@@ -1559,7 +1559,7 @@
 {
 public:
        // copy constructor (fix a BUG in msvc7 compiler)
-       tcpstream(const tcpstream &rhs):TCPStream(rhs) {};
+       tcpstream(const tcpstream &rhs);

        /**
         * Construct an unopened "tcpstream" object.
###### patch for socket.h #### cut here ######


###### patch for socket.cpp #### cut here ######
--- socket_orig.cpp     Thu Aug  5 10:26:18 2004
+++ socket.cpp  Thu Aug  5 10:27:53 2004
@@ -2000,6 +2000,11 @@
        setError(false);        /* no exceptions */
 }

+tcpstream::tcpstream(const tcpstream &rhs) :
+TCPStream(rhs)
+{
+}
+
 tcpstream::tcpstream(const char *addr, int buf) :
 TCPStream()
 {
###### patch for socket.cpp #### cut here ######


I would really appreciate if these patches find their way into commoncpp.

Regards,
Georg Soffel







From MAILER-DAEMON Sat Aug 07 08:11:10 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BtQ2Y-0001C4-HL
	for mharc-bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:11:10 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1Bsj0r-0003sU-7D
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 10:14:33 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1Bsj0p-0003sB-Sc
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 10:14:32 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1Bsj0p-0003s8-Pb
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 10:14:31 -0400
Received: from [207.44.134.82] (helo=texas.floripa.com.br)
	by monty-python.gnu.org with smtp (Exim 4.34) id 1Bsix0-0005z0-BV
	for bug-commoncpp@gnu.org; Thu, 05 Aug 2004 10:10:34 -0400
Received: (qmail 7482 invoked from network); 5 Aug 2004 14:08:33 -0000
Received: from unknown (HELO cli005.brasmap) (200.180.76.13)
	by idc.floripa.com.br with SMTP; 5 Aug 2004 14:08:27 -0000
Date: Thu, 5 Aug 2004 11:10:53 -0300
From: Marcelo Dalmas <mad@aqx.com.br>
To: bug-commoncpp@gnu.org
Message-Id: <20040805111053.20bdad59@cli005.brasmap>
In-Reply-To: <OFF9C69E62.A9143AF3-ONC1256EE7.00308258@uk.marconicomms.com>
References: <OFF9C69E62.A9143AF3-ONC1256EE7.00308258@uk.marconicomms.com>
Organization: AQ Brasil
X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="Multipart=_Thu__5_Aug_2004_11_10_53_-0300_Q+IWM/QvBTwKSN.o"
X-Mailman-Approved-At: Sat, 07 Aug 2004 08:11:09 -0400
Subject: Re: patches to remove compiler warnings
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: Thu, 05 Aug 2004 14:14:33 -0000

This is a multi-part message in MIME format.

--Multipart=_Thu__5_Aug_2004_11_10_53_-0300_Q+IWM/QvBTwKSN.o
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On more patch ;)

On Thu, 5 Aug 2004 11:07:53 +0200
"Georg Soffel" <Georg.Soffel@marconi.com> wrote:

> Dear all,
>=20
> part of our code quality policy is to switch on as much compiler
> warnings as possible.

[snip]

> I would really appreciate if these patches find their way into
> commoncpp.
>=20
> Regards,
> Georg Soffel
>=20

--=20
---------------------------------------------
Marcelo Dalmas - Eng. de Controle e Automa=E7=E3o
---------------------------------------------
            AQX Instrumenta=E7=E3o
http://www.aqx.com.br   Fone: (48)2107-2724
mailto:info@aqx.com.br  Fax:  (48) 333-3745
---------------------------------------------

--Multipart=_Thu__5_Aug_2004_11_10_53_-0300_Q+IWM/QvBTwKSN.o
Content-Type: application/octet-stream;
 name="warrning.patch"
Content-Disposition: attachment;
 filename="warrning.patch"
Content-Transfer-Encoding: base64

SW5kZXg6IGluY2x1ZGUvY2MrKy90aHJlYWQuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9v
dC9jb21tb25jcHAvY29tbW9uY3BwMi9pbmNsdWRlL2NjKysvdGhyZWFkLmgsdgpyZXRyaWV2aW5n
IHJldmlzaW9uIDEuMzYuNC4yOQpkaWZmIC11IC1yMS4zNi40LjI5IHRocmVhZC5oCi0tLSBpbmNs
dWRlL2NjKysvdGhyZWFkLmgJNCBKdWwgMjAwNCAxNToxNDowNyAtMDAwMAkxLjM2LjQuMjkKKysr
IGluY2x1ZGUvY2MrKy90aHJlYWQuaAk1IEF1ZyAyMDA0IDE0OjAxOjIwIC0wMDAwCkBAIC0xODky
LDcgKzE4OTIsNyBAQAogCQkJeyByZXR1cm4gZ2V0VGltZSh0bG9jKTsgfTsKIAogICAgICAgICBz
dGF0aWMgaW50IGdldFRpbWVPZkRheShzdHJ1Y3QgdGltZXZhbCAqdHApOwotICAgICAgICBzdGF0
aWMgaW50IGdldHRpbWVvZmRheShzdHJ1Y3QgdGltZXZhbCAqdHAsIHN0cnVjdCB0aW1lem9uZSAq
dHpwKQorICAgICAgICBzdGF0aWMgaW50IGdldHRpbWVvZmRheShzdHJ1Y3QgdGltZXZhbCAqdHAs
IHN0cnVjdCB0aW1lem9uZSopCiAJCQl7IHJldHVybiBnZXRUaW1lT2ZEYXkodHApOyB9OwogICAg
ICAgICAKICAgICAgICAgc3RhdGljIHN0cnVjdCB0bSAqZ2V0TG9jYWxUaW1lKGNvbnN0IHRpbWVf
dCAqY2xvY2ssIHN0cnVjdCB0bSAqcmVzdWx0KTsK

--Multipart=_Thu__5_Aug_2004_11_10_53_-0300_Q+IWM/QvBTwKSN.o--




From MAILER-DAEMON Sat Aug 07 08:34:58 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BtQPa-000220-CK
	for mharc-bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:34:58 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BtQPY-00021v-VE
	for bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:34:57 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BtQPW-00021i-Up
	for bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:34:56 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BtQPW-00021f-SZ
	for bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:34:54 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BtQL7-0002Z6-MP
	for bug-commoncpp@gnu.org; Sat, 07 Aug 2004 08:30:21 -0400
Received: from [192.168.1.101] (pool-138-89-248-140.atc.east.verizon.net
	[138.89.248.140])
	by mail.ostel.com (Postfix) with ESMTP id D5E2E2F288F;
	Sat,  7 Aug 2004 05:34:43 -0700 (PDT)
Message-ID: <4114CB5B.5030803@ostel.com>
Date: Sat, 07 Aug 2004 08:30:19 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.1 (Macintosh/20040626)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Marcelo Dalmas <mad@aqx.com.br>
References: <OFF9C69E62.A9143AF3-ONC1256EE7.00308258@uk.marconicomms.com>
	<20040805111053.20bdad59@cli005.brasmap>
In-Reply-To: <20040805111053.20bdad59@cli005.brasmap>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: patches - and 1.3.0 release
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, 07 Aug 2004 12:34:57 -0000

I do not know if I have seen the other patches offhand, but this one I 
have added for the 1.3 release.

Since I mentioned it, it is probably worth noting what is in 1.3.0 at 
this time:

first, buffer has been moved from ccext2 to ccgnu2.  Second, the various 
complex and system specific semaphore implimentations have been stripped 
out and a single posix semaphore implimention built around conditional 
is now being used.  This also means that semaphore wait can now be a 
timed operation and improves compatibility between w32 and posix 
semaphore behavior.  Speaking of w32, we are back to using w32 critical 
sections for mutex locking speed.
Another change is that we have added ZStream classes.

Also a word on 64 bit interface support in 1.3; All classes that offer 
or operate on sized memory objects now use size_t for 64 bit cleanness 
at the interface level.  This does not nessisarly mean Common C++ 
performs 64 bit clean operations or uses 64 bit specific system 
functions in all cases yet internally, but it does assure that 
interfacing to lower level functions and system calls through Common C++ 
at least does not immediately downcast 64 bit parameters even before 
calling these functions.  Going forward as the internal structure of 
Common C++ is changed to use 64 bit clean system library functions, the 
external interface that Common C++ provides will not need to be further 
modified for 64 bit support as well.



Marcelo Dalmas wrote:

>On more patch ;)
>
>On Thu, 5 Aug 2004 11:07:53 +0200
>"Georg Soffel" <Georg.Soffel@marconi.com> wrote:
>
>  
>
>>Dear all,
>>
>>part of our code quality policy is to switch on as much compiler
>>warnings as possible.
>>    
>>
>
>[snip]
>
>  
>
>>I would really appreciate if these patches find their way into
>>commoncpp.
>>
>>Regards,
>>Georg Soffel
>>
>>    
>>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Bug-commoncpp mailing list
>Bug-commoncpp@gnu.org
>http://lists.gnu.org/mailman/listinfo/bug-commoncpp
>  
>



From MAILER-DAEMON Wed Aug 11 00:04:50 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BukM6-0001qV-Sw
	for mharc-bug-commoncpp@gnu.org; Wed, 11 Aug 2004 00:04:50 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BukM4-0001pm-TA
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 00:04:48 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BukM2-0001os-QY
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 00:04:48 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BukM2-0001n6-JJ
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 00:04:46 -0400
Received: from [199.232.41.8] (helo=mx20.gnu.org)
	by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168)
	(Exim 4.34) id 1BukI2-00025D-Ay
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 00:00:38 -0400
Received: from [65.32.5.132] (helo=ms-smtp-02.tampabay.rr.com)
	by mx20.gnu.org with esmtp (Exim 4.34) id 1BuczW-0005xr-A2
	for bug-commoncpp@gnu.org; Tue, 10 Aug 2004 16:13:02 -0400
Received: from ms-mss-03 (ms-mss-03-smtp [10.10.4.20])
	by ms-smtp-02.tampabay.rr.com (8.12.10/8.12.7) with ESMTP id
	i7AKAcZl019838
	for <bug-commoncpp@gnu.org>; Tue, 10 Aug 2004 16:10:38 -0400 (EDT)
Received: from tampabay.rr.com (localhost [127.0.0.1])
	by ms-mss-03.tampabay.rr.com
	(iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep  8 2003))
	with ESMTP id <0I28003J0YPQZC@ms-mss-03.tampabay.rr.com> for
	bug-commoncpp@gnu.org; Tue, 10 Aug 2004 16:10:38 -0400 (EDT)
Received: from [10.10.6.21] (Forwarded-For: [207.30.9.99])
	by ms-mss-03.tampabay.rr.com (mshttpd); Tue, 10 Aug 2004 16:10:38 -0400
Date: Tue, 10 Aug 2004 16:10:38 -0400
From: zemiandeng@cfl.rr.com
To: bug-commoncpp@gnu.org
Message-id: <43ec0043ecb3.43ecb343ec00@tampabay.rr.com>
MIME-version: 1.0
X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.21 (built Sep  8 2003)
Content-type: text/plain; charset=us-ascii
Content-language: en
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-Accept-Language: en
Priority: normal
X-Virus-Scanned: Symantec AntiVirus Scan Engine
Subject: questions/suggestions
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: zemiandeng@cfl.rr.com
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, 11 Aug 2004 04:04:49 -0000

Hi all,
I found commonc++ lib to be very useful and complete. Nice work! :) I would like to participant in current issues. Is there a way to subscribe to this mailing list?

I have few questions/suggestions:
* What is "ost" namespace stand for?
* What is the down side to seperate classes into individual files? I found the socket.cpp/h file covers too many classess.
* Is there a plan on adding Database API?

Thanks.

~ zemian deng ~




From MAILER-DAEMON Wed Aug 11 05:55:52 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1Buppn-0003HD-SA
	for mharc-bug-commoncpp@gnu.org; Wed, 11 Aug 2004 05:55:51 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1Buppm-0003H7-BI
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 05:55:50 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1Buppk-0003Gj-Jd
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 05:55:49 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1Buppk-0003GZ-Fp
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 05:55:48 -0400
Received: from [142.161.130.102] (helo=mx-mtaout02.mts.net)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BuplQ-00036A-Bh
	for bug-commoncpp@gnu.org; Wed, 11 Aug 2004 05:51:20 -0400
Received: from curtman.magyar ([142.161.106.65]) by mx-mtaout02.mts.net
	with ESMTP
	id <20040811095119.XQFO8206.mx-mtaout02.mts.net@curtman.magyar>;
	Wed, 11 Aug 2004 04:51:19 -0500
From: Curtis Magyar <cumagyar@mts.net>
To: bug-commoncpp@gnu.org
In-Reply-To: <43ec0043ecb3.43ecb343ec00@tampabay.rr.com>
References: <43ec0043ecb3.43ecb343ec00@tampabay.rr.com>
Content-Type: text/plain
Date: Wed, 11 Aug 2004 04:52:16 -0500
Message-Id: <1092217936.8673.29.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 1.5.90 
Content-Transfer-Encoding: 7bit
Cc: zemiandeng@cfl.rr.com
Subject: Re: questions/suggestions
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, 11 Aug 2004 09:55:50 -0000

On Tue, 2004-08-10 at 16:10 -0400, wrote:
> Hi all,
> I found commonc++ lib to be very useful and complete. Nice work! :)
> I would like to participant in current issues.
> Is there a way to subscribe to this mailing list?

You can subscribe at the very hard to find mailman subscription page:
http://lists.gnu.org/mailman/listinfo/bug-commoncpp

This should really be linked to from at least one of the homepages.  :(


> I have few questions/suggestions:
> * What is "ost" namespace stand for?

I believe its Open Source Telecom or something like that.


> * What is the down side to seperate classes into individual files? I
> found the socket.cpp/h file covers too many classess.

Probably historical reasons.  For most intents and purposes that is all
hidden from you while you are using the library.  I can't see it giving
you much trouble.

> * Is there a plan on adding Database API?

I believe ost::ThreadFile is about as close as it gets.  There's
probably no reason you can't use MySQL++ or whatever in your commonc++
projects.

http://dev.mysql.com/downloads/other/plusplus/

Hope this helps.  (I'm a fellow CommonC++ user, not a developer)

--
Curtis Magyar





From MAILER-DAEMON Sun Aug 15 19:20:04 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1BwUIG-0003h9-I0
	for mharc-bug-commoncpp@gnu.org; Sun, 15 Aug 2004 19:20:04 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1BwUIE-0003h3-VL
	for bug-commoncpp@gnu.org; Sun, 15 Aug 2004 19:20:03 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1BwUIC-0003gr-QD
	for bug-commoncpp@gnu.org; Sun, 15 Aug 2004 19:20:02 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1BwUIC-0003gm-KY
	for bug-commoncpp@gnu.org; Sun, 15 Aug 2004 19:20:00 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1BwUE6-0007aG-GB
	for bug-commoncpp@gnu.org; Sun, 15 Aug 2004 19:15:46 -0400
Received: from [192.168.1.101] (pool-141-150-183-195.atc.east.verizon.net
	[141.150.183.195])
	by mail.ostel.com (Postfix) with ESMTP id 853312F288F;
	Sun, 15 Aug 2004 16:21:14 -0700 (PDT)
Message-ID: <411FEE9C.9090605@ostel.com>
Date: Sun, 15 Aug 2004 19:15:40 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.1 (Macintosh/20040626)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Fedemp@altern.org
Subject: cvs stable2 branch and tcp sockets
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: Sun, 15 Aug 2004 23:20:03 -0000

I just completed a number of changes in the "-r stable2" branch for the 
upcoming 1.3.0 release of Common C++.  The most interesting effect to 
existing applications include adding Socket options to the Socket base, 
updating UDPSocket base class and base I/O methods to directly support 
being in a connected state (this used to only get handled in derived 
classes), and having TCPStream buffer size directly associate with the 
tcp max segment size.   TCPStreams now also recompute socket send and 
receive buffers based on segment size.   The half duplex UDPTransmit and 
UDPReceive now zero the unused buffer (rcv for UDPTransmit, snd for 
UDPReceive).  Neither of these changes should directly effect older code 
that used default behaviors.  Indeed, ccrtp seems to compile and "seems" 
to still work.  For TCP applications, the only immediate difference is 
that when no buffer size is specified in a constructor, the default 
value is now 536 rather than 512.




From MAILER-DAEMON Wed Aug 25 17:27:17 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C05Ib-0000A1-1Z
	for mharc-bug-commoncpp@gnu.org; Wed, 25 Aug 2004 17:27:17 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C04Sq-0007id-VK
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 16:33:49 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C04So-0007hQ-Uo
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 16:33:48 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C04So-0007hN-Sa
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 16:33:46 -0400
Received: from [200.154.55.227] (helo=itapoa.terra.com.br)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C04Nw-0006QI-Vq
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 16:28:45 -0400
Received: from potosi.terra.com.br (potosi.terra.com.br [200.154.55.131])
	by itapoa.terra.com.br (Postfix) with ESMTP id 29C6FDD55DA
	for <bug-commoncpp@gnu.org>; Wed, 25 Aug 2004 17:28:42 -0300 (BRT)
Received: from terra.com.br (201008233023.user.veloxzone.com.br [201.8.233.23])
	(authenticated user diogo_cc)
	by potosi.terra.com.br (Postfix) with ESMTP id 90026370065
	for <bug-commoncpp@gnu.org>; Wed, 25 Aug 2004 17:28:41 -0300 (BRT)
Message-ID: <412CF679.7020704@terra.com.br>
Date: Wed, 25 Aug 2004 17:28:41 -0300
From: Diogo Costa <diogo_cc@terra.com.br>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Wed, 25 Aug 2004 17:27:15 -0400
Subject: Thread doesn't release it's memory after execution. How to make it
 release?
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, 25 Aug 2004 20:33:49 -0000

Hi,

I am writing a c++ program using the GNU Common C++ Library. I am not 
been able to release the memory a thread has taken after it was 
executed. How could I do it? My program just keep o getting more and 
more memmory.

For example, the follow program should release some memory after the 
father and child threads end, but it doesn't. What is wrong?

#include <cc++/thread.h>
#include <cstdio>
#include <cstring>
#include <iostream>

#ifdef  CCXX_NAMESPACES
using namespace std;
using namespace ost;
#endif

// Test child thread destroying before father
//
class Child: public Thread
{
public:
        Child()
        { }
        void run()
        {
                cout << "child start" << endl;
                Thread::sleep(6000);
                cout << "child end" << endl;
        }
        void final()
        {
                delete this;
        }
};

class Father: public Thread
{
public:
        Father()
        { }
        void run()
        {
                cout << "father start" << endl;
                Thread::sleep(2000);
                Thread *th = new Child();
                th->start();
                Thread *th2 = new Child();
                th2->start();
                Thread::sleep(10000);
                cout << "father end" << endl;
        }
        void final()
        {
                delete this;// - not used since detached threads self delete
                // reset memory to test access violation
                //memset(this,0,sizeof(*this));
        }
};

int main(int argc, char* argv[])
{
    Thread::sleep(2000);
    Father *th = new Father();
        th->start();
        Thread::sleep(20000);

        return 0;
}





From MAILER-DAEMON Thu Aug 26 04:53:30 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0G0f-0001vE-V9
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 04:53:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C089o-0001ba-8q
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 20:30:24 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C089k-0001b9-6p
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 20:30:23 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C089k-0001b6-48
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 20:30:20 -0400
Received: from [204.127.198.35] (helo=rwcrmhc11.comcast.net)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C084z-0007KM-DI
	for bug-commoncpp@gnu.org; Wed, 25 Aug 2004 20:25:25 -0400
Received: from officep4 (c-24-20-23-25.client.comcast.net[24.20.23.25])
	by comcast.net (rwcrmhc11) with ESMTP
	id <2004082600252301300raus0e>; Thu, 26 Aug 2004 00:25:24 +0000
From: <mwaitkin@comcast.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <16685.12300.469000.461670@gargle.gargle.HOWL>
Date: Wed, 25 Aug 2004 17:34:20 -0700
To: bug-commoncpp@gnu.org
X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp (Windows)" XEmacs Lucid
X-Mailman-Approved-At: Thu, 26 Aug 2004 04:53:27 -0400
Subject: Where is pdetach defined
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: Thu, 26 Aug 2004 00:30:24 -0000



pedatched is listed under the info generated documenation in the
*Daemon* section.  Where is this function defined?  I see no reference
to it within the source code.  Thx.

-mwa





From MAILER-DAEMON Thu Aug 26 05:13:02 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0GJa-0000pU-5J
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:13:02 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0GJX-0000mq-8n
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:12:59 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0GJT-0000in-Gl
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:12:58 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0GJT-0000iM-1I
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:12:55 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0GEp-0001H6-Ms
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:08:08 -0400
Received: by mail.ostel.com (Postfix, from userid 1005)
	id 8A03E2F2877; Thu, 26 Aug 2004 02:09:26 -0700 (PDT)
Received: from [192.168.1.121] (pool-141-150-183-195.atc.east.verizon.net
	[141.150.183.195])
	by mail.ostel.com (Postfix) with ESMTP id 02A4F2F2875;
	Thu, 26 Aug 2004 02:09:20 -0700 (PDT)
Message-ID: <412DA874.6010003@ostel.com>
Date: Thu, 26 Aug 2004 05:08:04 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: mwaitkin@comcast.net
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
In-Reply-To: <16685.12300.469000.461670@gargle.gargle.HOWL>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: Where is pdetach defined
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: Thu, 26 Aug 2004 09:12:59 -0000

If you are talking about more recent releases of Common C++ (1.1.x or 
later), pdetach() is now Process::detach() and is found in the process.h 
header.

mwaitkin@comcast.net wrote:
> 
> pedatched is listed under the info generated documenation in the
> *Daemon* section.  Where is this function defined?  I see no reference
> to it within the source code.  Thx.
> 
> -mwa
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp



From MAILER-DAEMON Thu Aug 26 05:34:01 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0Gds-0000JO-EJ
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:34:00 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0Gdp-0000HI-Uy
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:33:58 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0Gdl-0000Fz-VG
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:33:56 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0Gdk-0000EU-Ce
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:33:52 -0400
Received: from [212.83.3.66] (helo=post.atlantis.ru)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0GYM-00041B-Am
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 05:28:18 -0400
Received: (from root@localhost)
	by post.atlantis.ru (8.11.6/8.11.6) id i7Q8TKr32074;
	Thu, 26 Aug 2004 12:29:20 +0400
Received: from sun10.atlantis.ru (sun10.atlantis.ru [212.83.3.65] (may be
	forged))
	by post.atlantis.ru (8.11.6/8.11.6) with SMTP id i7Q8TK632071
	for <bug-commoncpp@gnu.org>; Thu, 26 Aug 2004 12:29:20 +0400
Received: from samael.dungeon.gollard.ru ([212.83.3.71])
	by sun10.atlantis.ru (8.9.2/8.9.2) with SMTP id NAA08606
	for <bug-commoncpp@gnu.org>; Thu, 26 Aug 2004 13:28:11 +0400 (MSD)
Date: Thu, 26 Aug 2004 13:32:21 +0400
From: Andrey Kulikov <ilfis@dezcom.mephi.ru>
X-Mailer: The Bat! (v2.00.6) Business
X-Priority: 3 (Normal)
Message-ID: <49249244437.20040826133221@dezcom.mephi.ru>
To: bug-commoncpp@gnu.org
In-Reply-To: <16685.12300.469000.461670@gargle.gargle.HOWL>
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Imposible to determine source IP in TCPStream & TCPSocket?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Andrey Kulikov <ilfis@dezcom.mephi.ru>
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: Thu, 26 Aug 2004 09:33:58 -0000

Good day!

CommonCPP 1.2.4
OS: Windows XP

I want to write small program, which wait connection on specific port,
and on accepting connectin write to console the IP-address and port,
from what the connection come.
For listen socket i'm using ost::TCPSocket class.

And my questions is how can i determine the source IP-address of the
connection without produce a new classes?

This is a example:
==========================================================
#include <iostream>
#include <cc++/socket.h>

using namespace std;
using namespace ost;

void acceptConnections(TCPSocket *a_listenSocket){
        while(true)
        {
                try{
                        while(a_listenSocket->isPendingConnection(50))
                        {
                                tpport_t pp;
                                TCPStream *stream =  new TCPStream(*a_listenSocket);

//                              Socket *s = (Socket *)stream;
//                              InetHostAddress addr = s->getSender(&pp);

                                InetHostAddress addr = a_listenSocket->getRequest(&pp);

                                cout << "Connection from " << inet_ntoa(addr.getAddress()) << ":" << pp << endl;

                                // Some data exhange...
                                
                                delete stream;
                        }
                }catch (Socket *ex) {
                        cout<<"Exception while accept connections:" << ex->getErrorString() <<endl;
                }
        }
}

int _tmain(int argc, _TCHAR* argv[])
{       
        TCPSocket *listenSocket = 0;
        int port = 4455;
        try
        {
                listenSocket = new TCPSocket("0.0.0.0", port);
                acceptConnections(listenSocket);
                delete listenSocket;
        }
        catch(Socket *socket)
        {
                cout << "Exception in program:" << socket->getErrorString() << endl;
        }
        return 0;
}
==========================================================

This code cause WSAError 10057 (Not connected) ("A request to send or receive data was
disallowed because the socket is not connected and (when sending on a
datagram socket using a sendto call) no address was supplied.")
in TCPSocket::getRequest method.

Get source IP-address from TCPStream also imposible, because getSender
method is a stub, and private. (What the reason for make this useful
method private?)

And if i try to cast TCPSocket to Socket, which has mehod getSender,
the returned result is a garbage. (seems returns uninitialized value).

Summary:
How can i determine connection's source IP-adress using TCPSocket?
Why TCPStream::getSender is stub and private?

-- 
Best regards,
 Andrey                            mailto:ilfis@dezcom.mephi.ru




From MAILER-DAEMON Thu Aug 26 06:58:32 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0Hxf-0006Ga-IS
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 06:58:31 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0Hxb-0006G7-Pl
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 06:58:28 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0Hxa-0006FZ-Eu
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 06:58:27 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0Hxa-0006FS-Bd
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 06:58:26 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0Hsb-0007Sk-U8
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 06:53:18 -0400
Received: by mail.ostel.com (Postfix, from userid 1005)
	id 398F22F2877; Thu, 26 Aug 2004 03:54:38 -0700 (PDT)
Received: from [192.168.1.121] (pool-141-150-183-195.atc.east.verizon.net
	[141.150.183.195])
	by mail.ostel.com (Postfix) with ESMTP id 8276E2F2875;
	Thu, 26 Aug 2004 03:54:34 -0700 (PDT)
Message-ID: <412DC11E.5090703@ostel.com>
Date: Thu, 26 Aug 2004 06:53:18 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Andrey Kulikov <ilfis@dezcom.mephi.ru>
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
	<49249244437.20040826133221@dezcom.mephi.ru>
In-Reply-To: <49249244437.20040826133221@dezcom.mephi.ru>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: Imposible to determine source IP in TCPStream & TCPSocket?
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: Thu, 26 Aug 2004 10:58:29 -0000

Hmm...thinking about this....

the better way would be to collect and cache the peer at the time the 
accept call itself is being made.

I am not sure why getSender in TCPStream was done that way offhand, 
either.  It may be a left-over from a time when there was no getSender 
method in the Socket base class and was never updated to complete the 
implimentation.

I will do some testing of solutions for both of these issues, probably 
later today.  It's easy enough to setup a test solution around the demo 
tcp.cpp, and once a working solution is found with appropriate library 
changes, it will be easy to see how to use it from said demo.  More than 
likely I will make getSender method work from TCPStream, and then look 
at the accept issues seperately.

Andrey Kulikov wrote:
> Good day!
> 
> CommonCPP 1.2.4
> OS: Windows XP
> 
> I want to write small program, which wait connection on specific port,
> and on accepting connectin write to console the IP-address and port,
> from what the connection come.
> For listen socket i'm using ost::TCPSocket class.
> 
> And my questions is how can i determine the source IP-address of the
> connection without produce a new classes?
> 
> This is a example:
> ==========================================================
> #include <iostream>
> #include <cc++/socket.h>
> 
> using namespace std;
> using namespace ost;
> 
> void acceptConnections(TCPSocket *a_listenSocket){
>         while(true)
>         {
>                 try{
>                         while(a_listenSocket->isPendingConnection(50))
>                         {
>                                 tpport_t pp;
>                                 TCPStream *stream =  new TCPStream(*a_listenSocket);
> 
> //                              Socket *s = (Socket *)stream;
> //                              InetHostAddress addr = s->getSender(&pp);
> 
>                                 InetHostAddress addr = a_listenSocket->getRequest(&pp);
> 
>                                 cout << "Connection from " << inet_ntoa(addr.getAddress()) << ":" << pp << endl;
> 
>                                 // Some data exhange...
>                                 
>                                 delete stream;
>                         }
>                 }catch (Socket *ex) {
>                         cout<<"Exception while accept connections:" << ex->getErrorString() <<endl;
>                 }
>         }
> }
> 
> int _tmain(int argc, _TCHAR* argv[])
> {       
>         TCPSocket *listenSocket = 0;
>         int port = 4455;
>         try
>         {
>                 listenSocket = new TCPSocket("0.0.0.0", port);
>                 acceptConnections(listenSocket);
>                 delete listenSocket;
>         }
>         catch(Socket *socket)
>         {
>                 cout << "Exception in program:" << socket->getErrorString() << endl;
>         }
>         return 0;
> }
> ==========================================================
> 
> This code cause WSAError 10057 (Not connected) ("A request to send or receive data was
> disallowed because the socket is not connected and (when sending on a
> datagram socket using a sendto call) no address was supplied.")
> in TCPSocket::getRequest method.
> 
> Get source IP-address from TCPStream also imposible, because getSender
> method is a stub, and private. (What the reason for make this useful
> method private?)
> 
> And if i try to cast TCPSocket to Socket, which has mehod getSender,
> the returned result is a garbage. (seems returns uninitialized value).
> 
> Summary:
> How can i determine connection's source IP-adress using TCPSocket?
> Why TCPStream::getSender is stub and private?
> 



From MAILER-DAEMON Thu Aug 26 07:39:30 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0IbK-0002EI-7O
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 07:39:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0IbI-0002Dj-Se
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 07:39:28 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0IbI-0002D4-2i
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 07:39:28 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0IbH-0002D1-UF
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 07:39:28 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0IWN-00057m-Ff
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 07:34:24 -0400
Received: by mail.ostel.com (Postfix, from userid 1005)
	id 3A8272F2877; Thu, 26 Aug 2004 04:35:44 -0700 (PDT)
Received: from [192.168.1.121] (pool-141-150-183-195.atc.east.verizon.net
	[141.150.183.195])
	by mail.ostel.com (Postfix) with ESMTP id 9ABD92F2875;
	Thu, 26 Aug 2004 04:35:38 -0700 (PDT)
Message-ID: <412DCABE.7060807@ostel.com>
Date: Thu, 26 Aug 2004 07:34:22 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Andrey Kulikov <ilfis@dezcom.mephi.ru>
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
	<49249244437.20040826133221@dezcom.mephi.ru>
In-Reply-To: <49249244437.20040826133221@dezcom.mephi.ru>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: Imposible to determine source IP in TCPStream & TCPSocket?
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: Thu, 26 Aug 2004 11:39:29 -0000

 From the TCPStream did you try the getPeer methods?

Andrey Kulikov wrote:
> Good day!
> 
> CommonCPP 1.2.4
> OS: Windows XP
> 
> I want to write small program, which wait connection on specific port,
> and on accepting connectin write to console the IP-address and port,
> from what the connection come.
> For listen socket i'm using ost::TCPSocket class.
> 
> And my questions is how can i determine the source IP-address of the
> connection without produce a new classes?
> 
> This is a example:
> ==========================================================
> #include <iostream>
> #include <cc++/socket.h>
> 
> using namespace std;
> using namespace ost;
> 
> void acceptConnections(TCPSocket *a_listenSocket){
>         while(true)
>         {
>                 try{
>                         while(a_listenSocket->isPendingConnection(50))
>                         {
>                                 tpport_t pp;
>                                 TCPStream *stream =  new TCPStream(*a_listenSocket);
> 
> //                              Socket *s = (Socket *)stream;
> //                              InetHostAddress addr = s->getSender(&pp);
> 
>                                 InetHostAddress addr = a_listenSocket->getRequest(&pp);
> 
>                                 cout << "Connection from " << inet_ntoa(addr.getAddress()) << ":" << pp << endl;
> 
>                                 // Some data exhange...
>                                 
>                                 delete stream;
>                         }
>                 }catch (Socket *ex) {
>                         cout<<"Exception while accept connections:" << ex->getErrorString() <<endl;
>                 }
>         }
> }
> 
> int _tmain(int argc, _TCHAR* argv[])
> {       
>         TCPSocket *listenSocket = 0;
>         int port = 4455;
>         try
>         {
>                 listenSocket = new TCPSocket("0.0.0.0", port);
>                 acceptConnections(listenSocket);
>                 delete listenSocket;
>         }
>         catch(Socket *socket)
>         {
>                 cout << "Exception in program:" << socket->getErrorString() << endl;
>         }
>         return 0;
> }
> ==========================================================
> 
> This code cause WSAError 10057 (Not connected) ("A request to send or receive data was
> disallowed because the socket is not connected and (when sending on a
> datagram socket using a sendto call) no address was supplied.")
> in TCPSocket::getRequest method.
> 
> Get source IP-address from TCPStream also imposible, because getSender
> method is a stub, and private. (What the reason for make this useful
> method private?)
> 
> And if i try to cast TCPSocket to Socket, which has mehod getSender,
> the returned result is a garbage. (seems returns uninitialized value).
> 
> Summary:
> How can i determine connection's source IP-adress using TCPSocket?
> Why TCPStream::getSender is stub and private?
> 



From MAILER-DAEMON Thu Aug 26 08:31:32 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0JPa-0006rJ-QT
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:31:27 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0JPU-0006pw-4R
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:31:20 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0JPQ-0006ot-TE
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:31:18 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0JPQ-0006oD-MC
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:31:16 -0400
Received: from [212.83.3.66] (helo=post.atlantis.ru)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0JJf-0004r8-7Q
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:25:19 -0400
Received: (from root@localhost)
	by post.atlantis.ru (8.11.6/8.11.6) id i7QBQP801452;
	Thu, 26 Aug 2004 15:26:25 +0400
Received: from sun10.atlantis.ru (sun10.atlantis.ru [212.83.3.65] (may be
	forged))
	by post.atlantis.ru (8.11.6/8.11.6) with SMTP id i7QBQP601449;
	Thu, 26 Aug 2004 15:26:25 +0400
Received: from samael.dungeon.gollard.ru ([212.83.3.71])
	by sun10.atlantis.ru (8.9.2/8.9.2) with SMTP id QAA12887;
	Thu, 26 Aug 2004 16:25:16 +0400 (MSD)
Date: Thu, 26 Aug 2004 16:29:26 +0400
From: Andrey Kulikov <ilfis@dezcom.mephi.ru>
X-Mailer: The Bat! (v2.00.6) Business
X-Priority: 3 (Normal)
Message-ID: <70259869078.20040826162926@dezcom.mephi.ru>
To: David Sugar <dyfet@ostel.com>
In-Reply-To: <412DCABE.7060807@ostel.com>
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
	<49249244437.20040826133221@dezcom.mephi.ru>
	<412DCABE.7060807@ostel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re[2]: Imposible to determine source IP in TCPStream & TCPSocket?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Andrey Kulikov <ilfis@dezcom.mephi.ru>
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: Thu, 26 Aug 2004 12:31:21 -0000

Hello David,

DS>  From the TCPStream did you try the getPeer methods?

Yes, if in previous example i write
InetHostAddress addr = stream->getPeer(&pp);
all works fine.
Thanks.
But what the difference between getSender() and getPeer() for TCPStream?

-- 
Best regards,
 Andrey                            mailto:ilfis@dezcom.mephi.ru




From MAILER-DAEMON Thu Aug 26 08:48:44 2004
Received: from mailman by lists.gnu.org with archive (Exim 4.33)
	id 1C0JgJ-0006vQ-Te
	for mharc-bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:48:44 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1C0JgH-0006uc-0a
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:48:41 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1C0JgC-0006st-O6
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:48:38 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1C0JgC-0006sp-Iv
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:48:36 -0400
Received: from [216.218.222.122] (helo=mail.ostel.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1C0JbR-0000fq-TV
	for bug-commoncpp@gnu.org; Thu, 26 Aug 2004 08:43:42 -0400
Received: by mail.ostel.com (Postfix, from userid 1005)
	id EB7CD2F2877; Thu, 26 Aug 2004 05:45:02 -0700 (PDT)
Received: from [192.168.1.121] (pool-141-150-183-195.atc.east.verizon.net
	[141.150.183.195])
	by mail.ostel.com (Postfix) with ESMTP id 8A5032F2875;
	Thu, 26 Aug 2004 05:45:01 -0700 (PDT)
Message-ID: <412DDAFE.7050509@ostel.com>
Date: Thu, 26 Aug 2004 08:43:42 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Andrey Kulikov <ilfis@dezcom.mephi.ru>
References: <16685.12300.469000.461670@gargle.gargle.HOWL>
	<49249244437.20040826133221@dezcom.mephi.ru>
	<412DCABE.7060807@ostel.com>
	<70259869078.20040826162926@dezcom.mephi.ru>
In-Reply-To: <70259869078.20040826162926@dezcom.mephi.ru>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: bug-commoncpp@gnu.org
Subject: Re: Imposible to determine source IP in TCPStream & TCPSocket?
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: Thu, 26 Aug 2004 12:48:42 -0000

getSender, in the Socket base class, is used to peek (examine) the 
origin of the next waiting packet in the socket receive buffer.  Since 
TCP sockets receive from a connected state, the origin is already known 
and does not change, hence getPeer.  I think getSender got stubbed out 
into a private member in TCPStream just so that it did not get inherited 
as a public method or get used, since it was inappropiate for use there.

Andrey Kulikov wrote:
> Hello David,
> 
> DS>  From the TCPStream did you try the getPeer methods?
> 
> Yes, if in previous example i write
> InetHostAddress addr = stream->getPeer(&pp);
> all works fine.
> Thanks.
> But what the difference between getSender() and getPeer() for TCPStream?
> 



