Re: socket closing

From: Glynn Clements (glynn.clements@virgin.net)
Date: Tue Apr 24 2001 - 17:48:44 EST


Mala Anand wrote:

> I am seeing similar problem using netpef3. After my client succefully
> closes (300 connections) I still see 320 sockets in /proc/pid/fd directory.
> When I list them they are shown as sockets (597 -> socket:[21780] ) but if
> I do stat I get the following:
>
> stat /proc/4776/fd/597
> File: "/proc/4776/fd/597"
> Size: 0 Filetype: Unknown
> Mode: (0777/?rwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
> Device: 0,0 Inode:21780 Links: 1
> Access: Tue Apr 24 14:00:20 2001
> Modify: Tue Apr 24 14:00:20 2001
> Change: Tue Apr 24 14:00:20 2001
>
> If I kill my server these files go away. The server calls shutdown to
> close both the data socket and control socket for each connection.

shutdown() does not close the descriptor; you have to call close().

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



This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:29 EST