gomez18 has asked for the wisdom of the Perl Monks concerning the following question:
I was opening sockets with IO::Socket::INET and using them throughout the course of a script. From time to time, these sockets had to be closed and possibly reopened at a later time. I had been closing them with 'shutdown(SOCK, 2)' since shutdown is described as a 'more insistent form of close' in the camel book.
The sockets appeared to be closing as the list of open connections on a 'netstat' didn't climb steadily as I would expect if they were staying open. However, if I did an 'fstat -u userid' I found well over 1000 open files for my script. These files seemed to be open network connections. Changing the script to use close rather than shutdown solved the problem right away.
My question, then, is why did shutdown work this way? Is my understanding of the camel book flawed somehow. Am I using shutdown in an odd way it was not intended? Thanks for any guidance you may have to offer.
An 8 bit man in a 32 bit world.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: shutdown vs. close on INET sockets
by ozone (Friar) on Aug 28, 2001 at 00:24 UTC | |
(tye)Re: shutdown vs. close on INET sockets
by tye (Sage) on Aug 28, 2001 at 00:41 UTC | |
by Anonymous Monk on Mar 20, 2009 at 14:59 UTC |