Re: (Simple) problem with sockets

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

 




Lee Chin wrote:

> Here is a slightly related question:
> When I get a file descriptor via an accept system call... lets say the
> remote client closes the connection pre-maturely.
> 
> Will that file descriptor be re-assigned by Linux BEFORE I call cose on it? 

No.

The descriptor is still valid at that point; e.g. calling read() on it
will return 0 (signifying EOF), and calling close() on it will succeed
(return 0, leave errno untouched).

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


[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