In article <80**************************@posting.google.com >, KaXo
<ka**@sina.com> wrote:
$r_socket = IO::Socket::INET->new(
PeerAddr => "10.0.26.78",
PeerPort => 17990,
Proto => 'tcp',
Timeout => 1
);
.....................
if ($r_socket && $r_socket->connected()) {
close($r_socket);
}
after close($r_socket), i use netstat -an to check the connecting list.
i found "TCP 10.0.28.117:4998 10.0.26.78:17990 TIME_WAIT"
how to close the socket connection completely?
The socket connection is kept open for 2-4 minutes to allow stray
packets scattered all over the world-wide internet to find their way
home. This is the "TIME_WAIT" state.
You can try setting the ReusePort (or ReuseAddr?) attribute on the
socket, which will allow you to reopen the socket sooner after you have
closed it.
FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future.