bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

exception in SampleSocketServiceServer::StopServer()


From: Klaus Triendl
Subject: exception in SampleSocketServiceServer::StopServer()
Date: Tue, 3 Sep 2002 12:35:14 +0200

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).


        virtual void StopServer()
        {
                m_bQuitServer = true;

                InetHostAddress host;
                tpport_t port;
                host = getLocal(&port);

                //This is required so that CreateSocketPort can return.
                TCPStream strm(host, port);

                waitMutex.enterMutex();
                waitMutex.leaveMutex();
        }


if i change the code a little and the host is initialized with an address
other than 0, there is not such a problem.


        virtual void StopServer()
        {
                m_bQuitServer = true;

                InetHostAddress host("127.0.0.1");
                tpport_t port;
                getLocal(&port);

                //This is required so that CreateSocketPort can return.
                TCPStream strm(host, port);

                waitMutex.enterMutex();
                waitMutex.leaveMutex();
        }



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?

--
triendl klaus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]