TCP status question


 
Thread Tools Search this Thread
Top Forums Programming TCP status question
# 1  
Old 08-19-2008
Question TCP status question

There is a server and a client,when client send a message to server,server can send a reply to client. The status of server and client is ESTABLISHED.Then I halt the client,I find the server status is CLOSE_WAIT and the client status is FIN_WAIT_2. Many minutes passed,I find the the server status still is CLOSE_WAIT and the client status still is FIN_WAIT_2. Why the status of server and client isn't CLOSED? Anybody could tell me the reason? I am puzzled with TCP status for a very long time.

Thanks
# 2  
Old 08-19-2008
I am no expert in TCP, but I know that if you 'abort' your client, the server is doing a 'passive close' and the server will go into 'CLOSE_WAIT' state. The time interval for close_wait will depend on the system.

In Solaris, you can find out all these time interval settings
Code:
$ for i in `ndd /dev/tcp \? | awk '/interval/{print $1}'`
  do
  echo "$i=`ndd /dev/tcp $i`"
  done
tcp_time_wait_interval=60000
tcp_ip_abort_cinterval=180000
tcp_ip_abort_linterval=180000
tcp_ip_abort_interval=480000
tcp_ip_notify_cinterval=10000
tcp_ip_notify_interval=10000
tcp_keepalive_interval=7200000
tcp_rexmit_interval_initial=3000
tcp_rexmit_interval_max=60000
tcp_rexmit_interval_min=400
tcp_deferred_ack_interval=100
tcp_fin_wait_2_flush_interval=675000
tcp_rexmit_interval_extra=0
tcp_co_timer_interval=20
tcp_local_dack_interval=50
tcp_ndd_get_info_interval=1000
tcp_push_timer_interval=50
tcp_close_wait_interval(obsoleted-=name is non-existent for this module
for a list of valid names, use name '?'

Recently I talked about the TIME_WAIT in my blog.
Chi Hung Chan: Lots of TIME_WAIT in Your Netstat
See the attached TCP state diagram to understand the relationship of various states.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Problem and question with TCP

Hi guys , i write this message for a doubt, a time ago i wrote a client/server program with TCP/IP in Linux. When i tested the program flooding the server with messages of 1024 bytes (Or 1025 bytes i dont remember exactly the number but was more that 1000 bytes) in certain point a message was... (5 Replies)
Discussion started by: Kovalevski
5 Replies

2. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

3. Shell Programming and Scripting

Perl Question Grep and exit status

Im being forced to write in perl. I prefer KSH or Expect, so I suppose its time to become more fluent with perl. I have the following problem. I want to loop through Filea and check that each line in Filea is resident in Fileb. Filea contents two four six eight houseboat Fileb... (4 Replies)
Discussion started by: sumguy
4 Replies

4. Shell Programming and Scripting

Terminate processes for CLOSE_WAIT status of TCP

Hello Friends, First of all im sorry for spending extra space in DB of forum with this thread, i know there would be a solution if i kept searching, I need to terminate the process which causes CLOSE_WAIT status of TCP connection via port 8103: -bash-3.00$ netstat -na | grep 8103... (3 Replies)
Discussion started by: EAGL€
3 Replies

5. IP Networking

Wireshark TCP and HTTP question.

Hello all. This is my first post and thank you for your forum. Here is my question. I have a simple setup at home and I was capturing some data with wireshark. Data between a workstation and the web server, requesting a page. Simple enough. Now when I open wireshark, I apply the TCP... (4 Replies)
Discussion started by: squaresphere
4 Replies

6. Programming

Getting TCP Port status through C API

Does anyone know if there is a C API call to get the status of a TCP port? As opposed to running netstat and parsing the results. At the moment I have to attempt to bind() and pick up on the address in use error which isn't very elegant Thanks ---------- Post updated at 10:42 AM ----------... (0 Replies)
Discussion started by: janra
0 Replies

7. Red Hat

How to kill a TCP connection which has status TIME_WAIT & no PID

Hi, I want to kill TCP connections which have status as TIME_WAIT & no PID (as per the output of the "netstat - p" command). Is there any command/utility available to kill connections to a specific port or IP address. The problem is that these connections don't have process ID (see... (4 Replies)
Discussion started by: Davinder31may
4 Replies

8. Programming

C & TCP question: AF_INET vs AF_UNIX

Greetings! I am attempting to write a *basic* network client in C. I have manage to create a socket but I have doubts as far as using AF_INET vs AF_UNIX. At the present time, my client runs with AF_INET. Is AF_UNIX faster across hosts using the same OS flavor (Red Hat)? What is the difference... (1 Reply)
Discussion started by: Alan Christen
1 Replies

9. Programming

How to check TCP server status

Please tell me according to C/C++ socket programming; how client can check whether server is running or not during TCP communication. (1 Reply)
Discussion started by: mansoorulhaq
1 Replies

10. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
Login or Register to Ask a Question