Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

PlRPC and TIME_WAIT

by shushu (Scribe)
on Dec 27, 2002 at 11:23 UTC ( [id://222518]=perlquestion: print w/replies, xml ) Need Help??

shushu has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I am using PlRPC to execute a method on a remote server. My client is Linux RH 7.3 with Perl 5.6.1, and my server in WinNT 4.0 with Perl 5.5.3.

The action works fine, but when I want to disconnect, I want to do it good.
Up until now all I do is "close $client->{socket}", but although looking at the TCPDUMP the whole 4 ways handshake looks fine, I still get "TIME_WAIT" on the client side for several seconds.

It wasn't problematic, but Since I need to open lots of connections like that (not all to the same machine, and no, I can't keep the connection alive), it might cause a problem.

The question is - is there a better way to close the connection ?

TIA,
shushu

Replies are listed 'Best First'.
Re: PlRPC and TIME_WAIT
by shushu (Scribe) on Dec 27, 2002 at 12:04 UTC
    I have just saw the command "shutdown" that might help me.
    http://www.perldoc.com/perl5.005_03/pod/func/shutdown.html
    Unfortunately, I will check it only in few days...
    shushu
      TIME_WAIT is perfectly normal for the socket shutdown.

      <http://www.samag.com/documents/s=1323/sam0110e/0110e.htm>

      "To address the problem, I had to understand what happens when a TCP connection is closed. Figure 1 illustrates these steps. After the Web server returns the requested Web page to a browser, it sends a connection termination request (FIN) to indicate that its end of the connection has been closed. When the browser acknowledges (ACK) the Web server's FIN, the Web server enters FIN_WAIT_2 state. The browser then sends a connection termination request (FIN) to the Web server indicating that it has closed its end of the connection. The Web server acknowledges (ACK) the browser's FIN. The Web server enters TIME_WAIT state and stays that way for time_wait interval. During this period, the kernel data structure resources associated with the TCP connection remain assigned. This is done in case any straggling packets are lingering on the network."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://222518]
Approved by IlyaM
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found