[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: void SocketService::run(void) ... if (FD_ISSET(so, &err))... Socket
From: |
Wolfgang |
Subject: |
Re: void SocketService::run(void) ... if (FD_ISSET(so, &err))... SocketPort:::disconnect() |
Date: |
Sat, 27 Dec 2003 22:37:17 +0100 |
User-agent: |
KMail/1.5.4 |
Am Samstag, 27. Dezember 2003 12:16 schrieb Christian Prochnow:
> On Saturday 27 December 2003 00:54, Wolfgang wrote:
> > so how is SocketPort::disconnect() (if(FD_ISSET(so, &err)...) to be
> > used?
>
> Hi !
>
> You cannot detect a disconnect through the select() or poll() system calls.
> When a disconnect occurs a read event is triggered. Reading from the socket
> then returns 0-bytes which indicates that the connection has been closed.
>
>
> Regards,
> Christian Prochnow
Hello Christian,
thx - that is how i detect a disconnect right now. i think that also -1 can be
returned in case the other party has not read their receive buffer before the
disconnect happend. (so i do check for dlen<=0 not dlen== 0).
But i would like to raise the question again: in which case will
SocketPort::disconnect() be called?
My guess would be: in case of incoming OOB data but i might be wrong.
best regards
Wolfgang