From MAILER-DAEMON Fri Feb 02 13:56:13 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HD3a1-0004Bb-0j
	for mharc-bug-commoncpp@gnu.org; Fri, 02 Feb 2007 13:56:13 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HD3Zz-0004BI-1C
	for bug-commoncpp@gnu.org; Fri, 02 Feb 2007 13:56:11 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HD3Zx-0004B5-Cb
	for bug-commoncpp@gnu.org; Fri, 02 Feb 2007 13:56:09 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HD3Zx-0004B2-8t
	for bug-commoncpp@gnu.org; Fri, 02 Feb 2007 13:56:09 -0500
Received: from mta066b.interbusiness.it ([85.37.17.66])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HD3Zw-0008UG-Ac
	for bug-commoncpp@gnu.org; Fri, 02 Feb 2007 13:56:08 -0500
Received: from host123-160-static.29-87-b.business.telecomitalia.it (HELO
	[192.168.0.1]) ([87.29.160.123])
	by MTA066B.interbusiness.it with ESMTP; 02 Feb 2007 19:55:46 +0100
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AgAAAKcXw0VXHaB7/2dsb2JhbAANgwM3iAqBZpJIAQEBAQ
Message-ID: <45C38933.4090000@bigfoot.com>
Date: Fri, 02 Feb 2007 19:55:47 +0100
From: Wakan <wakan@bigfoot.com>
User-Agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: David Sugar <dyfet@gnutelephony.org>
References: <NBBBKGBBDBMONCPMINHBMEBDLGAB.Conrad@Pino.com>
	<45BBC29A.8060608@gnutelephony.org>
	<45BCE39B.10408@bigfoot.com> <45BCF437.4050100@bigfoot.com>
	<45BCF930.6010904@gnutelephony.org> <45BD084F.5080603@bigfoot.com>
	<45BD3261.6000903@gnutelephony.org>
In-Reply-To: <45BD3261.6000903@gnutelephony.org>
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
X-detected-kernel: FreeBSD 2.0-4.2
Cc: bug-commoncpp@gnu.org
Subject: Re: can't release mutex
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: Fri, 02 Feb 2007 18:56:11 -0000

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-15"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I'm afraid of semaphores don't resolve my problem...<br>
What about Conditional?<br>
How to use it?<br>
Have you got some suggestions on how to implement the "time sharing"<br>
with commoncpp instruments?<br>
Carlo<br>
<br>
<br>
<br>
David Sugar ha scritto:
<blockquote cite="mid45BD3261.6000903@gnutelephony.org" type="cite">
  <pre wrap="">No, any OTHER thread that would have blocked on that lock will continue
after the timeout...so if you are using a common lock, you want another
thread to hit it, and use the wait to enter, as it can then see if the
lock got stuck, while your processing thread does so without a timeout....


Wakan wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">OK David,
first of all thanks for your precious help...
only a clarifying question (clarifying for me of course... :)):

when the library function execution exceeds the timeout value,
the piece of code in:

		if(!semimutex.wait(timeout)) {
	----------&gt; library must have crashed, etc...
		}

runs automatically? That is: is there a sort of "goto" that let the
execution continue within the
if statement? I put this question because (besides my ignorance), if I
have to put an external loop that checks for the
timeout, like...

	if(isPending(pendingInput)) {
	---&gt;	while(1) {
			if(!semimutex.wait(timeout)) {
				library must have crashed, etc...
			}
			call library function ...
			semimutex.post();
		}
	}

it probably won't resolve my problem, because when external library get
stucked, the program can't go on,
and never will reach the beginning of the external loop, never will
excute the piece of code of the timeout condition.
If there is an automatic "goto" instead, then I think it will work fine.

And more, in this way I can implement a sort of "time sharing", because
even if my server is multithread, actually only 1 thread can execute until
the library function exits (it isn't a fix execution time), so it's a
fake multithread and performance speed is heavily penalized indeed.
To have this working, I have to increase the couter of the semaphore?
Can you make other example of the semaphore usage please?
or suggest some documentation to read about this?

Thanks again for your help.
Carlo


David Sugar ha scritto:
    </pre>
    <blockquote type="cite">
      <pre wrap="">What you are thinking of is something like this:

	Semaphore semimutex(1);

	...
	if(isPending(pendingInput)) {
		if(!semimutex.wait(timeout)) {
			library must have crashed, etc...
		}
		call library function ...
		semimutex.post();
	}

Hence wait is used like a enterMutex, post like a leaveMutex, and only
one instance can pass through because it has a count of 1.  Since wait
supports a timeout, you can use that for your failure detect.

The Common C++ Semaphore is actually implemented as a combination of
mutex and a conditional.

Wakan wrote:
  
      </pre>
      <blockquote type="cite">
        <pre wrap="">Thanks for your reply.
Can you write an example with the semaphore in this context?
Thanks,
Carlo

Wakan ha scritto:
    
        </pre>
        <blockquote type="cite">
          <pre wrap="">Thanks for your reply.
Can you write an example with the semaphore in this context?
Thanks,
Carlo

David Sugar ha scritto:
      
          </pre>
          <blockquote type="cite">
            <pre wrap="">I think what he really wants to do is use the Common C++ Semaphore with
a count of 1, since semaphore can block with a "timeout", and with a "1"
count in effect acts as a mutex...

The larger question though of what to do with the stuck thread, perhaps
from a broken library, is important also.  He could cancel the thread in
question if it timed out, and put cleanup code in the thread destructor
when he invokes delete to join it, but if the library allocated
resources he cannot determine for them to get cleanly deallocated.

Conrad T. Pino wrote:
  
        
            </pre>
            <blockquote type="cite">
              <pre wrap="">You're on the right track.  Please pardon my rusty recollection syntax.
Revise:

	mutex.enterMutex();

to a form that accepts a timeout.  This example won't compile:

	const int timeout = 500;

	while (1) {
		if ( isPending( pendingInput ) ) {
			int result = mutex.enterMutex( timeout );

			if ( result == success ) {
				---&gt; protected function call (a function that can't work 
				in multithread env) &lt;---       
				mutex.leaveMutex();
			} else {
				// do something else with pending input
			}
		}
	}

While the above will implement your timeout idea it does nothing about
the fundamental problem.  When the library "breaks" can be discoverd
and the blocked mutex/thread combination can be cancelled/restared
HOWEVER PROPRIETARY LIBRARY STATE IS INCONSISTENT &amp; LIKELY DANGEROUS.

If the library is dynamically loaded under your control then unload it
and reload it to get it back into a consistent state.  If it's auto or
static linked then you may have an unsolveable problem.

If a reliable system is your goal then one of these MUST be true:

		proprietary library NEVER fails
	OR
		proprietary library can be forced back to a consistent
		state because it has a reload or reinitialize method

Good luck.

    
          
              </pre>
              <blockquote type="cite">
                <pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:bug-commoncpp-bounces+conrad=pino.com@gnu.org">bug-commoncpp-bounces+conrad=pino.com@gnu.org</a>
[<a class="moz-txt-link-freetext" href="mailto:bug-commoncpp-bounces+conrad=pino.com@gnu.org">mailto:bug-commoncpp-bounces+conrad=pino.com@gnu.org</a>]On Behalf Of Wakan
Sent: Saturday, January 27, 2007 07:18
To: <a class="moz-txt-link-abbreviated" href="mailto:bug-commoncpp@gnu.org">bug-commoncpp@gnu.org</a>
Subject: can't release mutex

Hi,
I'm using commoncpp library in a project that includes a multithread 
server that
can accept many tcp connection and each connection generates a thread.
In this server I'm using a thirdy party proprietary library (compiled), 
that (as the producer says)
can't work in multithread environment.
As each connection thread needs to call functions of this thirdy party 
library, I've used a mutex to protect the piece of
code where this external library function is called.
In this way I can use this library fine, because all calls are 
serialized and the protected function is called by one thread each time.
This is an example:
...
    while(1) {
        if(isPending(pendingInput)) {
                mutex.enterMutex();
                ---&gt; protected function call (a function that can't work 
in multithread env) &lt;---       
                mutex.leaveMutex();
       }
    }
...
in 99% of cases it works fine. But it accidentally happens that a thread 
can't exit from the mutex
maybe because the thirdy party function freezes itself.
When this happens, the server can accept other connections, soit still 
works, but each thread can't enter in the mutex proteced piece of code.
I'm thinking about something, like a timeout, that exits the mutex after 
a time, if the thread is not exiting...
Can someone help me to resolve this problem? Are there other solutions?
Thanks in advance,
Regards
Carlo
      
            
                </pre>
              </blockquote>
              <pre wrap="">_______________________________________________
Bug-commoncpp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bug-commoncpp@gnu.org">Bug-commoncpp@gnu.org</a>
<a class="moz-txt-link-freetext" href="http://lists.gnu.org/mailman/listinfo/bug-commoncpp">http://lists.gnu.org/mailman/listinfo/bug-commoncpp</a>
    
          
              </pre>
            </blockquote>
            <pre wrap="">__________ NOD32 2011 (20070127) Information __________

This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>

  
        
            </pre>
          </blockquote>
          <pre wrap="">__________ NOD32 2014 (20070128) Information __________

This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
------------------------------------------------------------------------

_______________________________________________
Bug-commoncpp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bug-commoncpp@gnu.org">Bug-commoncpp@gnu.org</a>
<a class="moz-txt-link-freetext" href="http://lists.gnu.org/mailman/listinfo/bug-commoncpp">http://lists.gnu.org/mailman/listinfo/bug-commoncpp</a>


__________ NOD32 2014 (20070128) Information __________

This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>

  
      
          </pre>
        </blockquote>
        <pre wrap="">------------------------------------------------------------------------

_______________________________________________
Bug-commoncpp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bug-commoncpp@gnu.org">Bug-commoncpp@gnu.org</a>
<a class="moz-txt-link-freetext" href="http://lists.gnu.org/mailman/listinfo/bug-commoncpp">http://lists.gnu.org/mailman/listinfo/bug-commoncpp</a>
    
        </pre>
      </blockquote>
      <pre wrap="">
__________ NOD32 2014 (20070128) Information __________

This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>

  
      </pre>
    </blockquote>
    <pre wrap="">
------------------------------------------------------------------------

_______________________________________________
Bug-commoncpp mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bug-commoncpp@gnu.org">Bug-commoncpp@gnu.org</a>
<a class="moz-txt-link-freetext" href="http://lists.gnu.org/mailman/listinfo/bug-commoncpp">http://lists.gnu.org/mailman/listinfo/bug-commoncpp</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->

__________ NOD32 2015 (20070128) Information __________

This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>

  </pre>
</blockquote>
<br>
</body>
</html>



From MAILER-DAEMON Sun Feb 11 19:55:49 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HGPTx-0004Si-6G
	for mharc-bug-commoncpp@gnu.org; Sun, 11 Feb 2007 19:55:49 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HGPTu-0004S8-Nt
	for bug-commoncpp@gnu.org; Sun, 11 Feb 2007 19:55:46 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HGPTs-0004Rt-Kk
	for bug-commoncpp@gnu.org; Sun, 11 Feb 2007 19:55:45 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1HGPTs-0004Rq-Ez; Sun, 11 Feb 2007 19:55:44 -0500
Received: from outbound.mailhop.org ([63.208.196.171])
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52)
	id 1HGPTs-0005eJ-38; Sun, 11 Feb 2007 19:55:44 -0500
Received: from pool-72-76-21-88.nwrknj.fios.verizon.net ([72.76.21.88]
	helo=[192.168.1.90])
	by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.63) (envelope-from <dyfet@gnutelephony.org>)
	id 1HGPTq-000Hfb-Sk; Sun, 11 Feb 2007 19:55:42 -0500
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 72.76.21.88
X-Report-Abuse-To: abuse@dyndns.com (see
	http://www.mailhop.org/outbound/abuse.html for abuse reporting
	information)
X-MHO-User: dyfet
Message-ID: <45CFBB0D.3000305@gnutelephony.org>
Date: Sun, 11 Feb 2007 19:55:41 -0500
From: David Sugar <dyfet@gnutelephony.org>
User-Agent: Thunderbird 1.5.0.9 (X11/20070130)
MIME-Version: 1.0
To: bug-commoncpp@gnu.org,  Ccrtp-devel@gnu.org
X-Enigmail-Version: 0.94.0.0
Content-Type: multipart/mixed; boundary="------------080404060705040707020707"
X-detected-kernel: FreeBSD 4.6-4.9
Cc: mmueller@soxy.ch, pmaurer@soxy.ch
Subject: A new secure sip proxy
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: Mon, 12 Feb 2007 00:55:47 -0000

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

There is a new security sip proxy which apparently uses Common C++ core
classes and ccrtp.  I wonder if anyone has looked at this project yet
(http://www.sip-soxy.org).  It also reminds me why we have to be careful
when thinking about any major changes in GNU Common C++ so that we do
not break "upstream projects".  Some of the more radical ideas I have in
mind for Common C++ 2.0 will be introduced initially in a new package
first, and the more effective and relevant parts will be migrated as
they mature and are tested.  One thing I very much want to do early on
however is solve open issues with proper IPV6 support in ccrtp.



--------------080404060705040707020707
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 201 215 2609
url:http://www.gnutelephony.org
version:2.1
end:vcard


--------------080404060705040707020707--



From MAILER-DAEMON Fri Feb 16 16:00:38 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HIAC6-0007sQ-S6
	for mharc-bug-commoncpp@gnu.org; Fri, 16 Feb 2007 16:00:38 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HIAC5-0007sJ-7o
	for bug-commoncpp@gnu.org; Fri, 16 Feb 2007 16:00:37 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HIAC3-0007s3-0y
	for bug-commoncpp@gnu.org; Fri, 16 Feb 2007 16:00:36 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HIAC2-0007s0-Rx
	for bug-commoncpp@gnu.org; Fri, 16 Feb 2007 16:00:34 -0500
Received: from smtpout19.attiva.biz ([85.37.16.21])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HIAC2-0005uk-Dj
	for bug-commoncpp@gnu.org; Fri, 16 Feb 2007 16:00:34 -0500
Received: from FBCMFE02B06.fbc.local ([192.168.30.94]) by smtpout19.attiva.biz
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Fri, 16 Feb 2007 21:37:48 +0100
Received: from [192.168.0.1] ([87.29.160.123]) by FBCMFE02B06.fbc.local with
	Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Feb 2007 21:37:48 +0100
Message-ID: <45D6161F.5000301@bigfoot.com>
Date: Fri, 16 Feb 2007 21:37:51 +0100
From: Wakan <wakan@bigfoot.com>
User-Agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 16 Feb 2007 20:37:48.0679 (UTC)
	FILETIME=[52459170:01C7520A]
X-detected-kernel: Windows 2000 SP4, XP SP1+
X-Greylist: delayed 1324 seconds by postgrey-1.27 at monty-python;
	Fri, 16 Feb 2007 15:59:56 EST
Subject: isPending(pendingError) useless
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: Fri, 16 Feb 2007 21:00:37 -0000

Please,
some can explain how to use isPending(pendingError) to realize
that the other end of the socket is disconnected?
I'm trying this:

    setKeepAlive() ;
    while(!isPending(pendingError,0)) {
        if(isPending(pendingInput)) {
            nBytesAvail = peek(str,500);
            nBytesRead = readData(str,nBytesAvail);
           
            if(nBytesAvail > 0) {
                .... 
            }
            else break;   // if this break is missing, it doesn't 
realize that the connection is down, but loops forever, so 
isPending(pendingError,0) doesn't work
        }
    }

If the client disconnects because a network error, the only way to know that
is to reduce the /proc/sys/net/ipv4/tcp_keepalive_time to 30
and tcp_keepalive_probe to 3 (has already suggested by someone in this list)
Is there a way to work better?
I tried to while(1) instead of while(!isPending(pendingError,0)) and if 
works in the
same way...is it right? so how to use isPending(pendingError)?
Thanks in advance




From MAILER-DAEMON Mon Feb 19 07:17:26 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HJ7SQ-000380-PD
	for mharc-bug-commoncpp@gnu.org; Mon, 19 Feb 2007 07:17:26 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HJ7SP-00037v-Eh
	for bug-commoncpp@gnu.org; Mon, 19 Feb 2007 07:17:25 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HJ7SM-00037j-TJ
	for bug-commoncpp@gnu.org; Mon, 19 Feb 2007 07:17:24 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HJ7SM-00037g-O8
	for bug-commoncpp@gnu.org; Mon, 19 Feb 2007 07:17:22 -0500
Received: from smtpout21.attiva.biz ([85.37.16.23])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HJ7SM-00038i-Co
	for bug-commoncpp@gnu.org; Mon, 19 Feb 2007 07:17:22 -0500
Received: from FBCMFE02B12.fbc.local ([192.168.30.89]) by smtpout21.attiva.biz
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Mon, 19 Feb 2007 13:16:37 +0100
Received: from [192.168.0.1] ([87.29.160.123]) by FBCMFE02B12.fbc.local with
	Microsoft SMTPSVC(6.0.3790.1830); Mon, 19 Feb 2007 13:16:37 +0100
Message-ID: <45D9952A.3070605@bigfoot.com>
Date: Mon, 19 Feb 2007 13:16:42 +0100
From: Wakan <wakan@bigfoot.com>
User-Agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 19 Feb 2007 12:16:37.0165 (UTC)
	FILETIME=[CD7DEDD0:01C7541F]
X-detected-kernel: Windows 2000 SP4, XP SP1+
Subject: binary data transmit with TCPStream
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: Mon, 19 Feb 2007 12:17:25 -0000

I'm sending binary data over a socket connection using TCPStream.
I'm using:
                tcp.write(row[3],tpl_size);
                tcp << endl;
where row[3] contains binary data.

I know that if I remove the tcp << endl; no data are sent (no data result
available on the other socket end).
The problem is that I'm transmitting binary data, and the \n character 
may be present
in the data packet I'm sending to the other and, that will in this way 
analyze an incomplete
data pack.
In which way can I resolve that problem? How can I transmit in secure 
way binary data
over the socket connection?




From MAILER-DAEMON Tue Feb 20 18:27:17 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HJeOC-0001vS-T0
	for mharc-bug-commoncpp@gnu.org; Tue, 20 Feb 2007 18:27:16 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HJb8k-0008DR-Rg
	for bug-commoncpp@gnu.org; Tue, 20 Feb 2007 14:59:06 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HJb8j-0008Cr-Pp
	for Bug-commoncpp@gnu.org; Tue, 20 Feb 2007 14:59:06 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HJb8j-0008Cf-He
	for Bug-commoncpp@gnu.org; Tue, 20 Feb 2007 14:59:05 -0500
Received: from www.nabble.com ([72.21.53.35] helo=talk.nabble.com)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32)
	(Exim 4.52) id 1HJb8j-0008IW-3M
	for Bug-commoncpp@gnu.org; Tue, 20 Feb 2007 14:59:05 -0500
Received: from [72.21.53.38] (helo=jubjub.nabble.com)
	by talk.nabble.com with esmtp (Exim 4.50) id 1HJb8h-0008Gs-Mg
	for Bug-commoncpp@gnu.org; Tue, 20 Feb 2007 11:59:03 -0800
Message-ID: <9069198.post@talk.nabble.com>
Date: Tue, 20 Feb 2007 11:59:03 -0800 (PST)
From: NaNu <emmanuel.guiton@elodig.fr>
To: Bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: emmanuel.guiton@elodig.fr
X-detected-kernel: Linux 2.4-2.6
X-Mailman-Approved-At: Tue, 20 Feb 2007 18:27:14 -0500
Cc: 
Subject: Undefined reference to
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: Tue, 20 Feb 2007 19:59:07 -0000


Hi,

When trying to compile a program using the cc++ library, I get the following
error:

undefined reference to `ost::IPV4Address::IPV4Address(char const*,
ost::IPV4Validator const*)

while I have include the header file:
#include <cc++/address.h>

In fact I get this error for any class which is defined in this file.
Does someone have any clue on the problem?

Thanks for any help,
 - Emmanuel
-- 
View this message in context: http://www.nabble.com/Undefined-reference-to-tf3262848.html#a9069198
Sent from the Gnu - Common C++ mailing list archive at Nabble.com.




From MAILER-DAEMON Wed Feb 21 04:17:25 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HJnbJ-0003bF-T9
	for mharc-bug-commoncpp@gnu.org; Wed, 21 Feb 2007 04:17:25 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HJnbH-0003b5-Q4
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 04:17:23 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HJnbG-0003ab-4N
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 04:17:23 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HJnbF-0003aW-T3
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 04:17:22 -0500
Received: from smtpout14.attiva.biz ([85.37.16.16])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HJnbF-0005Z7-HS
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 04:17:21 -0500
Received: from FBCMFE02B12.fbc.local ([192.168.30.89]) by smtpout14.attiva.biz
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Wed, 21 Feb 2007 10:17:12 +0100
Received: from [192.168.0.1] ([87.29.160.123]) by FBCMFE02B12.fbc.local with
	Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Feb 2007 10:17:11 +0100
Message-ID: <45DC0E17.6070908@bigfoot.com>
Date: Wed, 21 Feb 2007 10:17:11 +0100
From: Wakan <wakan@bigfoot.com>
User-Agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Feb 2007 09:17:11.0928 (UTC)
	FILETIME=[11BC9F80:01C75599]
X-detected-kernel: Windows 2000 SP4, XP SP1+
Subject: but...who does reply?
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, 21 Feb 2007 09:17:24 -0000

I'm asking myself if someone will never reply to our question...
or please tell us where to post and to ask for help.




From MAILER-DAEMON Wed Feb 21 15:44:18 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HJyK2-00014W-5T
	for mharc-bug-commoncpp@gnu.org; Wed, 21 Feb 2007 15:44:18 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HJyK0-00012x-VK
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 15:44:17 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HJyJy-0000xZ-Ra
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 15:44:15 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HJyJy-0000xQ-M6
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 15:44:14 -0500
Received: from smtpout17.attiva.biz ([85.37.16.19])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HJyJy-0000lp-7C
	for bug-commoncpp@gnu.org; Wed, 21 Feb 2007 15:44:14 -0500
Received: from fbcmfe02b04.fbc.local ([192.168.30.33]) by smtpout17.attiva.biz
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Wed, 21 Feb 2007 21:44:12 +0100
Received: from [192.168.0.1] ([87.29.160.123]) by fbcmfe02b04.fbc.local with
	Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Feb 2007 21:44:12 +0100
Message-ID: <45DCAF1D.8090404@bigfoot.com>
Date: Wed, 21 Feb 2007 21:44:13 +0100
From: Wakan <wakan@bigfoot.com>
User-Agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Feb 2007 20:44:12.0124 (UTC)
	FILETIME=[0AE361C0:01C755F9]
X-detected-kernel: Windows 2000 SP4, XP SP1+
Subject: bug on isPending(Socket::pendingInput) and buffer reading (REPLY
 PLEASE!!!)
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, 21 Feb 2007 20:44:17 -0000

I'm using this piece of code (a client):
        TCPStream tcp(addr,4096,512);
         .....
                    tcp << "B";         // send to the server
                    tcp << level;
                    tcp << "0384";
                   
                    tcp.write(row[3],tpl_size);
                    tcp << endl;
       ......
                    if(tcp.isPending(Socket::pendingInput,50000)) {    
               
                        tcp >> ris;       // read server reply
                        ....
                   }

What I notice (after long time I was having this problem, but not 
knowing why):
After about 10hrs of work (but not on all clients...it happens 
randomly), it happens that this client gets the server reply,
but it's the previouos server reply!...not what the server writes NOW on 
the socket (I can see what the server writes),
but the PREVIOUS reply.......the server writes 1000, 1001, 1002.....the 
client reads 0999, 1000, 1002 starting from
an random moment (after some hours) on...
In this situation I see that in the output of a 'netstat -anp', the 
Recv-Q buffer of the client side connection contains something (6 bytes),
even after a reading.
On the next write/read cycle, there still remain 6 bytes in the Recv-Q 
and so on...
Is there a way to empty the buffer?
Why the tcp >> ris; don't put all the Recv-Q content in ris, but leaves 
something?
Please, help me...I'm desperate...
(If I'm mistaking on writing here, to bug-commoncpp@gnu.org, please tell 
me where is a new
mailing list, of group....)
Carlo






From MAILER-DAEMON Tue Feb 27 08:08:27 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1HM24B-0005Pj-KO
	for mharc-bug-commoncpp@gnu.org; Tue, 27 Feb 2007 08:08:27 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1HM24A-0005NO-7e
	for bug-commoncpp@gnu.org; Tue, 27 Feb 2007 08:08:26 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1HM249-0005Lo-8Y
	for bug-commoncpp@gnu.org; Tue, 27 Feb 2007 08:08:25 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1HM249-0005LY-3P
	for bug-commoncpp@gnu.org; Tue, 27 Feb 2007 08:08:25 -0500
Received: from smtprelay01.ispgateway.de ([80.67.18.13])
	by monty-python.gnu.org with esmtp (Exim 4.52) id 1HM248-0004Mv-I4
	for bug-commoncpp@gnu.org; Tue, 27 Feb 2007 08:08:24 -0500
Received: (qmail 12737 invoked from network); 27 Feb 2007 13:08:20 -0000
Received: from unknown (HELO [10.6.100.2]) ([pbs]649393@[85.126.4.74])
	(envelope-sender <triendl.kj@mbox.at>)
	by smtprelay01.ispgateway.de (qmail-ldap-1.03) with AES256-SHA
	encrypted SMTP for <wakan@bigfoot.com>; 27 Feb 2007 13:08:20 -0000
Message-ID: <45E42D41.5040001@mbox.at>
Date: Tue, 27 Feb 2007 14:08:17 +0100
From: Klaus Triendl <triendl.kj@mbox.at>
Organization: M-BOX
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: Wakan <wakan@bigfoot.com>
References: <45D9952A.3070605@bigfoot.com>
In-Reply-To: <45D9952A.3070605@bigfoot.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-kernel: Linux 2.4-2.6
Cc: bug-commoncpp@gnu.org
Subject: Re: binary data transmit with TCPStream
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: Tue, 27 Feb 2007 13:08:26 -0000

Wakan schrieb:
> I'm sending binary data over a socket connection using TCPStream.
> I'm using:
>                tcp.write(row[3],tpl_size);
>                tcp << endl;
> where row[3] contains binary data.

...

> In which way can I resolve that problem? How can I transmit in secure
> way binary data
> over the socket connection?

Hi Wakan,

I don't know how things are now with the newest release, but as of
1.0.5, TCPStream was made for sending text, not binary data.

This was the reason why I implemented my own BinaryTCPStream on the
client side and a binary streaming server (BinaryServer derived from
TCPSocket and BinaryPort derived from SocketPort) - which might not be
portable as I used it solely on windows. And things got more difficult
on the server because I needed a responsive server even one request was
currently being processed.

There sould be an example in the library how to implement your own
SocketPort as far as I can remember.



--
Klaus Triendl



