[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exception in SampleSocketServiceServer::StopServer()
From: |
Federico Montesino Pouzols |
Subject: |
Re: exception in SampleSocketServiceServer::StopServer() |
Date: |
Fri, 6 Sep 2002 17:31:30 +0200 |
User-agent: |
Mutt/1.4i |
On Tue, Sep 03, 2002 at 12:35:14PM +0200, Klaus Triendl wrote:
> hi everybody,
>
> i tested the SampleSocketServiceServer with linux and windows. under windows
> an exception is thrown in StopServer().
> i traced the problem and figured out that WSAGetLastError() in
> Socket::connectError() returns WSAEFAULT (=10014L).
>
...
>
> if i change the code a little and the host is initialized with an address
> other than 0, there is not such a problem.
>
...
> on linux, this is not a problem either, but i didn't try it yet with my
> revised code.
> should the getLocal() method be changed?
>
From what I read in the demo sources, the reverser server is
listeing on INADDR_ANY; getLocal should return that value, could you
confirm it?
When StopServer builds the TCPStream object, it tries to
connect to INADDR_ANY and this seems to be what fails on Win32. I am
not familiar with this problem, but the winsock reference says the
following about WSAEFAULT:
"The name or the namelen parameter is not a valid part of the
user address space, the namelen parameter is too small, or the name
parameter contains incorrect address format for the associated address
family."
I suppose that the win32 connect does not like INADDR_ANY and
crashes.
We could add a check in Socket::getLocal so that when in win32
and the address is null, 127.0.0.1 is returned, but I think we should
not, since we would lose the possibility to know that an InetAddress
object has the INADDR_ANY value.
> --
> triendl klaus
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp