bug-commoncpp
[Top][All Lists]
Advanced

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

void SocketService::run(void)... if(FD_ISSET(so, &err))... SocketPort::


From: Wolfgang
Subject: void SocketService::run(void)... if(FD_ISSET(so, &err))... SocketPort:::disconnect()
Date: Sat, 27 Dec 2003 00:54:54 +0100
User-agent: KMail/1.5.4

Hello,

i tried to get an idea why SocketPort::disconnect() does not get called from a 
SocketService, when a disconnect happend (i.e a client that disconnects). so 
i looked into port.cpp (void SocketService::run(void), what makes me a bit 
confused. 
in line 771 (given that CCXX_USE_POLL is not defined):

"select(hiwater, &inp, &out, &err, tvp);"

&err is used as the fd_set to identify disconnects. however, i thought that 
this fd_set would be used to detect oob-data.
this would explain, why  SocketPort:::disconnect() does not get called, when a 
client disconnects on a tcp-socket.

so how is SocketPort::disconnect()  (if(FD_ISSET(so, &err)...) to be used?

Thx in advance

Wolfgang




from port.cpp (line 701-723)
++++snip++++
#else
                MUTEX_START
                onEvent();
                port = first;
                while(port)
                {
                        onCallback(port);
                        so = port->so;
                        if(FD_ISSET(so, &err)) {
                                port->detect_disconnect = false;

                                SocketPort* p = port;
                                port = port->next;
                                p->disconnect();
                                continue;
                        }

                        if(FD_ISSET(so, &inp))
                                port->pending();

                        if(FD_ISSET(so, &out))
                                port->output();

++++snap++++

and later on 

++++snip++++
                        if(port->detect_disconnect)
                                FD_SET(so, &err);
....
....
                        select(hiwater, &inp, &out, &err, tvp);

....
++++snap++++





reply via email to

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