Overview
Features
Download
Documentation
Community
Add-Ons & Services

StreamSocket connection issues

Please post support and help requests here.
dagg
Posts: 18
Joined: 28 Mar 2008, 09:07

StreamSocket connection issues

Postby dagg » 01 Apr 2008, 11:36

hello, I'm using poco (version 1.3.2) under gentoo 64 bit, gcc 4.2.0
I've never been able to achive valid TCP connection using
StreamSocket, I'm using c++ client and a java server, on the first try, I got connection but apperently the StreamSocket sent an
tag without been asked to, thus the server flunked, on the second try, the connection was made but terminated instantly.

under c++ I'm used

Code: Select all


Poco::Net::StreamSocket socket(Poco::Net::SocketAddress(host, "5221") );

or

Code: Select all


Poco::Net::StreamSocket socket;
socket.connect(Poco::Net::SocketAddress(host, "5221") );

none of them worked on the second try

on the server side, I used

Code: Select all


 final ConnectionHandler newConnection = new
 ConnectionHandler(this.serverSocket.accept(), new EchoProtocol());
                new Thread(newConnection).start();

the server worked perfectly with a java client

I have no idea why it worked the first time but not the second time.
can it be gcc or 64 bit related?

p.s. great work, handling XML using SAX with jdom took me 5 days, with SAXparser from poco it took 8 hours to write and test!
the DFS idea is great.
keep up the good work

peter
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria

Re: StreamSocket connection issues

Postby peter » 03 Apr 2008, 12:56

> hello, I'm using poco (version 1.3.2) under gentoo 64 bit, gcc 4.2.0
> I've never been able to achive valid TCP connection using
> StreamSocket, I'm using c++ client and a java server, on the first try, I got connection but apperently the StreamSocket sent an
tag without been asked to, thus the server flunked, on the second try, the connection was made but terminated instantly.

Hmm, it's hard to tell from the distance what is wrong here. Could you debug your application and set a breakpoint in StreamSocketImpl::sendBytes? Examining the call stack should give us more details to work with.

br

Peter

>
> under c++ I'm used
>

Code: Select all


> Poco::Net::StreamSocket socket(Poco::Net::SocketAddress(host, "5221") );
>

> or
>

Code: Select all


> Poco::Net::StreamSocket socket;
> socket.connect(Poco::Net::SocketAddress(host, "5221") );
>

> none of them worked on the second try
>
> on the server side, I used
>

Code: Select all


>  final ConnectionHandler newConnection = new
>  ConnectionHandler(this.serverSocket.accept(), new EchoProtocol());
>                 new Thread(newConnection).start();
>

> the server worked perfectly with a java client
>
> I have no idea why it worked the first time but not the second time.
> can it be gcc or 64 bit related?
>
> p.s. great work, handling XML using SAX with jdom took me 5 days, with SAXparser from poco it took 8 hours to write and test!
> the DFS idea is great.
> keep up the good work


Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests