[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: newbie questions rsh and open sockets



On Wed, Sep 03, 2003 at 10:58:39AM +0530, Anand Raman wrote:

| Shouldnt the socket connections be closed the moment rsh completes
| the command execution

No.

| [root@harry root]# netstat
| Active Internet connections (w/o servers)
| Proto Recv-Q Send-Q Local Address           Foreign Address         State
| tcp        0      0 10.210.5.45:shell       10.210.5.71:1017 	TIME_WAIT
| tcp        0      0 10.210.5.45:1023        10.210.5.71:1016 	TIME_WAIT
                                                                ^^^^^^^^^
TIME_WAIT is one of the states defined for a TCP socket in RFC 793
(the specification for TCP).  Read section 3.5 to understand what
happens when a connection is closed.  Basically the system must still
accept (and ACK) packets for a short while for clean up.  It is
possible for some packets to take a longer route than others and thus
(legitimately) arrive after the connection is closed.

-D

-- 
There is not a righteous man on earth
    who does what is right and never sins.
        Ecclesiastes 7:20
 
http://dman13.dyndns.org/~dman/

Attachment: pgpifcJ8aTNoZ.pgp
Description: PGP signature


Reply to: