< I have a server program that as far as I can tell correctly opens and
< sockets to clients.
< However, after a while, (A LONG TIME) my sockets build up and dont get
< closed. I have insrumented my code to make sure I am closing any file
< descriptor I receive over via accept.
< For the first 2 hours, when I do a socklist, I see just as many sockets
< my server program as there are clients
< After 2 hours or so though, the sockets keep building up and the file
< descriptors I get from accept kep increasing.
< My question is, how do I tell what these (UNCLOSED) file descriptors
< to ?
< I can so a stat on /proc/PID/fd/FILE and I get something like this:
< stat /proc/10881/fd/44
< File: "/proc/10881/fd/44" -> "socket:"
< Size: 64 Blocks: 2 Symbolic Link
< Access: (0700/lrwx------) Uid: ( 501/ grao) Gid: ( 501/
< Device: 4 Inode: 713130028 Links: 1
< Access: Tue Apr 24 12:10:20 2001
< Modify: Tue Apr 24 12:10:20 2001
< Change: Tue Apr 24 12:10:20 2001
< How do I get more info on that file descriptor so I can debug where I am
< going wrong?
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: ) but if
I do stat I get the following:
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.
Linux Technology Center - Performance
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to email@example.com
This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:29 EST