Sponsored Content
Full Discussion: Socket endpoints disconnects
Top Forums Programming Socket endpoints disconnects Post 302554877 by eoa on Tuesday 13th of September 2011 09:23:20 AM
Old 09-13-2011
Socket endpoints disconnects

Hello,

I am able to establish a connection, and transfer data. Occasionally the receiving client will block in read(2) and stay that way until it is killed.

initial:
Code:
server: netstat -aveeopT
tcp        0      0 *:17398                     *:*                         LISTEN      server-user     49951      13406/server off (0.00/0/0)

(Connection established and data transferred)

Lost connection:
Code:
server: netstat -aveeopT
tcp        0 534312 server-ip:17398   client-ip:57566           ESTABLISHED server-user     57181      13406/server on (0.51/2/0)

client: netstat -aveeopT
tcp        0      0 client-ip:57566 server-ip:17398   ESTABLISHED client-user    44526      27082/client off (0.00/0/0)

At this point the server issues write(2) calls on the non-blocking socket and receives -1/errno=EAGAIN, eventually the socket times out and write(2) returns -1/errno=ETIMEDOUT. The server then close(2) the connection.

Code:
server:netstat -aveeopT
tcp        0      0 *:17398                     *:*                         LISTEN      server-user     49951      13406/server off (0.00/0/0)
client:netstat -aveeopT
tcp        0      0 client-ip:57566 server-ip:17398   ESTABLISHED client-user    44526      27082/client off (0.00/0/0)

********

The client is now stuck in read(2) on a blocking connection.

I don't have a lot of information about the server or client computers, but:
server:
Linux server-name 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

client:
Linux client-name 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

Have anyone seen this before ?
Any suggestions of how to debug this would be greatly appreciated. I am not exactly a tcp expert and could use some tips.

[This worked fine when the server was running on SunOS]


Regards,


Even

Last edited by pludi; 09-13-2011 at 10:35 AM..
 

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
Perlbal::Manual::Debugging(3pm) 			User Contributed Perl Documentation			   Perlbal::Manual::Debugging(3pm)

NAME
Perlbal::Manual::Debugging - Debugging Perlbal VERSION Perlbal 1.78. DESCRIPTION Perlbal has two ways of debugging. One of them is through a management console; the other is through debugging messages. Debugging in a console You'll need to set up a management service and use it to dump all the information you require. The comprehensive documentation on this process can be found at Perlbal::Manual::Management. Debugging messages You can control the ammount of debugging messages Perlbal dumps by setting the environment variable "PERLBAL_DEBUG" to a value between 0 and 4: PERLBAL_DEBUG = 0 # no debug PERLBAL_DEBUG = 4 # debug everything Debug level 1 You can activate basic debug by setting "PERLBAL_DEBUG" to 1: PERLBAL_DEBUG = 1 The following debugging messages are turned on: o When a connection to a backend is closed, Perlbal::BackendHTTP prints "Backend $self is done; closing..." o When a connection to a backend is killed, Perlbal::ClientProxy prints "Client ($self) closing backend ($backend)" o When an HTTP request fails to be parsed, Perlbal::HTTPHeaders prints "HTTP parse failure: $reason" o When the connection is promoted to SSL, Perlbal::TCPListener prints " .. socket upgraded to SSL!" Debug level 2 By setting the debug level to 2 you'll get all the messages from level 1. PERLBAL_DEBUG = 2 You will also get a few others: o When a connection to a backend is opened and ready to be written to, Perlbal::BackendHTTP prints "Backend $self is writeable!" o When a response is about to be handled, Perlbal::BackendHTTP prints "BackendHTTP: handle_response" o When a backend is ready to be read from, Perlbal::BackendHTTP prints "Backend $self is readable!" o When there's an error with the connection to the backend, Perlbal::BackendHTTP prints "BACKEND event_err" o Whenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints "ClientHTTPBase::setup_keepalive($self)" o Whenever the client is ready for more of its file, Perlbal::ClientHTTPBase prints "REPROXY SSL done" o Right after we've read a chunk of a file and when a reproxy request is about to be sent, Perlbal::ClientHTTPBase prints "REPROXY Sent: $sent" o When we've written all data in the queue (and are about to stop waiting for write notifications), Perlbal::ClientHTTPBase prints "All writing done to $self" o Whenever a client proxy is about to be closed, Perlbal::ClientProxy prints "Perlbal::ClientProxy closed", followed by a possible "again" and a possible "saying $reason" o When a client has disconnected, Perlbal::ClientProxy prints "ClientProxy::client_disconnected" o When a backend requests a client of a high priority request and the client is available, "Service" in Perlbal prints "Got from fast queue, in front of $backlog others" o When a backend requests a client of a normal priority request and the client is available, "Service" in Perlbal prints "Backend requesting client, got PRIORITY = $cp-"{fd}.> o When a backend requests a client of a low priority request and the client is available, "Service" in Perlbal prints "Backend requesting client, got low priority = $cp-"{fd}.> o When header are being read, Perlbal::Socket prints "Perlbal::Socket::read_headers($self) is_res=$is_res" Debug level 3 PERLBAL_DEBUG = 3 By setting the debug level to 3 you'll get all the messages from level 1 and 2 plus the following: o Right before response headers are written to the client, Perlbal::BackendHTTP prints " writing response headers to client" o As we're writing to the client, Perlbal::BackendHTTP prints " content_length=VALUE" and " remain=VALUE", where the values are "undef" if they are not defined o If we're done writing to the client, Perlbal::BackendHTTP prints " done. detaching." o Whenever we're determining if we should be sending keep-alive header information back to the client, Perlbal::ClientHTTPBase prints " service's persist_client = $persist_client" o While determining if we should be sending keep-alive header information back to the client, if we were sent "content-length" or it's a head request, as we're doing a keep alive Perlbal::ClientHTTPBase prints " doing keep-alive to client" o If we're not sending keep-alive header information back ot the client, Perlbal::ClientHTTPBase prints " doing connection: close" o Right after we've finished sending all of the results to the user, Perlbal::ClientProxy prints "ClientProxy::backend_finished" o When we've sent a response to a user fully and we need to reset state, Perlbal::ClientProxy prints "ClientProxy::http_response_sent -- resetting state" o When we're writing a response to a client, Perlbal::ClientProxy prints "ClientProxy::event_write" o After writing a response to a client, if it is still connected and we're triggering trigger our backend to keep reading, Perlbal::ClientProxy prints " unstalling backend" o When reading a request, Perlbal::ClientProxy prints "ClientProxy::event_read" o When reading a request and just before we read the headers, Perlbal::ClientProxy prints " no headers. reading." o When reading a request, if we're not buffering to disk or we're no longer reading, as we disable reads, Perlbal::ClientProxy prints " disabling reads." o As we're reading, Perlbal::ClientProxy prints " reading $read_size bytes (VALUE bytes remain)", where "VALUE bytes remain" can be <undef> o After each read, Perlbal::ClientProxy prints " read $len bytes" o After we finished reading the request, Perlbal::ClientProxy prints " done_reading = $done_reading, backend = BACKEND", where "BACKEND" can be "undef" o When we send the headers to the backend and it responds before we're done reading from the client, further reads from the client are discarded; in this situation Perlbal::ClientProxy prints " already responded.". If the client continues to send data, Perlbal::ClientProxy prints " already responded [2]." and then gives up on reading o After reading, and having a backend available where we can write to, just before we do, Perlbal::ClientProxy prints " got a backend. sending write to it." o After reading, if there's no backend available, Perlbal::ClientProxy prints " no backend. read_ahead = $self-"{read_ahead}.> o If we know we've already started spooling a file to disk and we're about to continue doing so, Perlbal::ClientProxy prints " bureason = $self-"{bureason}> o If a backend wasn't available and we're about to request one, Perlbal::ClientProxy prints " finally requesting a backend" o When we're trying to read headers and the client has disconnected, Perlbal::Socket prints " client disconnected" o If we need to remove a trailing " " from the headers, Perlbal::Socket prints " throwing away leading " o If we've read a packet with headers and by the end of it we can't find the end of them, Perlbal::Socket prints " can't find end of headers" o Once we've read some headers, Perlbal::Socket prints " pre-parsed headers: [$hstr]" o After reading headers, if there's additional content that we've read, we push it back; when we do so, Perlbal::Socket prints " pushing back $len bytes after header" o If we got bogus headers, and right before we close the connection due to a parsing failure, Perlbal::Socket prints " bogus headers" o If we got valid headers, Perlbal::Socket prints " got valid headers" o If we're reading buffered data from a client, Perlbal::Socket prints "draining readbuf from $self to $dest: [$$bref]" Debug level 4 By setting the debug level to 4 you get all the messages from levels 1 to 3. Plus, "write" is redefined so that whenever "write" is called it first prints "write($self, <$clen>"$content") from ($pkg, $filename, $line)". PERLBAL_DEBUG = 4 SEE ALSO Perlbal::Manual::Configuration, Perlbal::Manual::Management. perl v5.14.2 2011-01-23 Perlbal::Manual::Debugging(3pm)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy