Re: SOCKETS, signal(), pthread???() and mutex???() - PROBLEMS

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

 



Luciano Moreira - igLnx wrote:

> 2) I ve noted that select() cannot detect socket shutdown()/closing from
> peer, always returning OK and leaving in FD the socket originally being
> tested by select().

select() just indicates that the socket is "ready"; this could mean
that data is available, or it could mean that the connection has been
terminated.

Connection termination is indicated by read(), recv() etc returning
zero, or by write(), send() etc either raising SIGPIPE, or (if SIGPIPE
is caught) failing with EPIPE (i.e. write() returns -1 and sets errno
to EPIPE).

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux