[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Cplusplus-devel]CommonC++(TCPStream) Question
From: |
Federico Montesino Pouzols |
Subject: |
Re: [Cplusplus-devel]CommonC++(TCPStream) Question |
Date: |
Tue, 4 Sep 2001 13:52:06 +0200 |
On Wed, Aug 29, 2001 at 03:28:53PM -0300, Sebastian Wain wrote:
> I was testing the CommonC++ 1.5.1 libraries under Linux, I tried to
> test the use of the TCPStream class in an trivial TCP client but I
> don't know how to do a trivial read from the socket (using the
> iostream logic). I attach the source.
Hi,
Have you been able to compile and run demo/tcpthread on your
box? If so, you should have no problem. But be careful, take into
account that you are trying to connect to port 23 (usually telnet),
and if there is no telnet server on that host, the constructor
`TCPStream client(add,23) will throw and exception (because connection
fails). This is not a fault but a feature of Common C++; you can also
specify arguments to the constructor in order to not throw exceptions.
Try other ports where you are sure there are servers
listening.
I attach two modified tcpclients. In the first, the TCPStream
constructor does not throw exceptions. In the second, exceptions are
not disabled in the TCPStream constructor.
I have had some problems with the second one, but I will
comment it in other post...
> Thank You
> Sebastian Wain
tcpstream-noexc.cpp
Description: Text document
tcpstream-exc.cpp
Description: Text document
- Re: [Cplusplus-devel]CommonC++(TCPStream) Question,
Federico Montesino Pouzols <=