If shutdownOutput() doesn’t cause other end to start TCP close



Hiya

I’m learning about TCP/IP and this stuff is just overwhelming


1. As far as I understand, when the passive-close end receives the
FIN, it doesn’t know whether the other end wants to stay in half-close
state ( in this case it should send data ) or to do full close( in
this case, it should send FIN )

We use shutdownOutput() to achieve half close, and close() to fully
close the connection. Now if none of the two methods force the passive-
close end to start TCP close sequence, why do we then use shutdown()
for half close connection? Why not just use close(), since it looks as
if both methods basically do the same thing ( terminating socket’s
output stream )?



2. If app does complete close, then TCP prevents infinite wait in
FIN_WAIT_2 state with setting the timer to aprox 10 minutes and if
connection is idle for that time period, TCP moves connection to
closed state.

a) But if app does half close, then this timer is not set and TCP
could be in FIN_WAIT_2 state for a very long time?




3. If linger on close is set to false, does on close() socket enter
FIN_WAIT_1 and from there to CLOSING state, or does it enter
FIN_WAIT_1 and from there to FIN_WAIT_2 state?



4. If client performs active open, but for some reason server doesn’t
receive none of client’s acknowledgements of server’s SYN, then:

a) I’m assuming that client is in established connection state, but
server is not?

b) does server go to close state and thus sends FIN or does it go to
listening state?
If the latter is true, then we have half open connection?


thank you
.



Relevant Pages

  • Re: [2.6.24.3][net] bug: TCP 3rd handshake abnormal timeouts
    ... server via TCP and non-persistent connections and all application level ... "Sometimes" when establishing a TCP connection to the server, ... Here is a simplified version of what _both_ the server and the client ...
    (Linux-Kernel)
  • Re: [2.6.24.3][net] bug: TCP 3rd handshake abnormal timeouts
    ... server via TCP and non-persistent connections and all application level ... "Sometimes" when establishing a TCP connection to the server, ... Here is a simplified version of what _both_ the server and the client ...
    (Linux-Kernel)
  • [2.6.24.3][net] bug: TCP 3rd handshake abnormal timeouts
    ... The case is about a bunch of web servers accessing a MySQL database server via TCP and non-persistent connections and all application level errors have been excluded. ... "Sometimes" when establishing a TCP connection to the server, we are seeing a 3000ms delay before the connection if effectively made. ... Here is a simplified version of what _both_ the server and the client see. ...
    (Linux-Kernel)
  • Re: Dropped Sessions Pervasive v7
    ... Pervasive is a slave to the TCP stack -- if the TCP connection is lost, ... Looking in to the PVSW.LOG file on a client machine ... > connections to the database server being dropped. ...
    (comp.databases.btrieve)
  • Re: NAT and keepaliveopen connection over TCP
    ... sent after 10 minutes of inactivity on the TCP connection. ... There's no minimum set time how long a NAT router should ... time-out inactive connections at the server. ...
    (microsoft.public.win32.programmer.networks)