Sponsored Content
Full Discussion: Socket endpoints disconnects
Top Forums Programming Socket endpoints disconnects Post 302556672 by eoa on Monday 19th of September 2011 09:21:46 AM
Old 09-19-2011
Hi,

********
> Are you sure you're performing a close.
Yes, since I am now logging the calls (see below).

> What do you mean by "shutdown the server". ...
Server responds to Ctrl-C by close(2) ing the listening socket and exit cleanly.

>> run on a SunOS computer, ...
> This seems to indicate that there is a problem...
Both the client and server software has worked for years (I know this doesn't prove anything).
However if one end is constantly calling write(2) and the other end is blocked in read(2) there isn't a lot of things that can go wrong (is it ?).

********

Four instances of the server runs on ports 17395..17398, clients issues two connections alternating on 17395/17396 and 17397/17398.

* When communication has stopped:
server issues non-blocking write(2) calls, client is blocked in read(2).

server retransmits continuously:
"17206","79.425849","server-ip","client-ip","TCP","[TCP Retransmission] 17395 > 34386 [ACK] Seq=1295964 Ack=224 Win=6912 Len=1448 TSV=528357141 TSER=3610227624"

Why does the client not respond to this ?
(A tail on the client log at this point in time shows no new entries).
The last client entry is :
10:10:37.406609 IP (tos 0x0, ttl 64, id 58005, offset 0, flags [DF], proto: TCP (6), length: 80) client-ip:34386 > server-ip:17395: ., cksum 0xf106 (correct), 223:223(0) ack 1295964 win 5114 <nop,nop,timestamp 3610227622 528289197,nop,nop,sack 3 {1339404:1933084}{1330716:1332164}{1319132:1323476}>
(It is possible that the tcpdump I/O buffers has not been flushed so that the log is not complete here).


netstat after the communication has stopped:

server$ netstat:
tcp 0 936856 server-ip:17395 client-ip:34386 ESTABLISHED

client$ netstat:
tcp 0 0 client-ip:34386 server-ip:17395 ESTABLISHED

The next thing that happens is that write(2) fails,
write(2) -> -1, errno = 110(TimeOut)
shutdown(fd, 2) -> -1, errno = 107 (Not connected)
close(fd) -> 0

No packets are transmitted when this happens.
And it seems the retransmissions have stopped.

Now the connection does not show up in netstat on the server, but on the client it is the same:

client$ netstat
tcp 0 0 client:34386 server:17395 ESTABLISHED


**********
The server reacts to Ctrl-C by doing a close(2) on the filedescriptor that was passed to bind/listen, and then exits cleanly.

When this happens no packets is transmitted and the
server process no longer exists

*********
Finally I kill the client with Ctrl-C
That cause 9 FIN events to be sent from the client.

netstat on the client shows that the connection is gone.

*********
It seems the client is continuously sending ACK for packet 1295964, why ?
"6512","11.705225","10.21.33.125","10.30.33.154","TCP","[TCP Dup ACK 5345#428] 34386 > 17395 [ACK] Seq=224 Ack=1295964 Win=654592 Len=0 TSV=3610227624 TSER=528289197 SLE=1339404 SRE=1950460 SLE=1330716 SRE=1332164 SLE=1319132 SRE=1323476"

And packets with this id (or whatever it is called) seems to be passed between the server and the client.

(attached two more logs, not sure if they reveal anything else).


Regards,

Even
 

8 More Discussions You Might Find Interesting

1. AIX

aix telnet disconnects

We're having problems getting disconnected from AIX with our telnet sessions. I can't ping the server when this happens, either. Other serves can be pinged at the same time. This happens both at unix and within the database. Database locks remain when editing files. unix logins remain after... (0 Replies)
Discussion started by: e1lyons
0 Replies

2. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

3. Windows & DOS: Issues & Discussions

Putty disconnects after sometime

i am using Putty to do ssh to all the unix nodes that we have in our work environment. it is very strange that all my network connections will timeout quickly in 10 mins, it can either be a putty connection, sqlplus or toad. is there some setting that can help to prevent this. please let me know... (3 Replies)
Discussion started by: sudhiroracle
3 Replies

4. Programming

can-not detect TCP disconnects well

Hello everyone. Thanks for reading. I am using Ubuntu 7.04 to experience this problem: I have written my own programs that communicate to eachother and I am having a hard time detecting a TCP socket disconnect when the remote side's computer has a power-failure (for example). On the computer... (6 Replies)
Discussion started by: pjwhite
6 Replies

5. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

6. Red Hat

Network disconnects often

Hi , My redhat 5 frequently disconnects from network. Once rebooted , network is working for one day or two. After that the NIC suddently stops working. Even if i give "#service network restart" or ifup eth0 commands it won't come up. I even tried reconfigure the network card. but no use. Only... (6 Replies)
Discussion started by: dknattukal
6 Replies

7. UNIX for Dummies Questions & Answers

Persistent terminal windows across viewer disconnects

Is there a way to have persistent terminal windows to redhat server across viewer disconnects? I can do that with the help of an extra MS Windows server and rdp, but is there a way of doing that without the Windows server? Here's the scenario. I have multiple redhat servers (VMs) which have no... (3 Replies)
Discussion started by: ad101
3 Replies

8. SCO

Telnet session disconnects abruptly

I have inherited and SCO OpenServer Release 6 server. The clients connect using telnet to get to a proprietary database application for Service tickets. The issue I am currently having is that the connection just stops abruptly and you can see "telnet session terminated" on the terminal emulation... (22 Replies)
Discussion started by: sean6605
22 Replies
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy