select function

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

 



Dear all,

I have a question about "select" function in Linux.
In a simple client-server program using tcp socket, the server accepts two client tcp request and does some processing by calling select function in order to differentiate each connection.


When I close the connection at the client side, for example, using pressing ctrl^c button,
the select function returns with some number meaing that the disconnected socket has some data to receive and finally goes to the infinite loop. I think that this happens because "select" function does not know the socket is disconnected.
Is there any method for select function to know whether the connection that select function listens to is disconnected or not?


Thanks.
- Yung Yi.

-
: 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