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
USB_EP_QUEUE(9) 					      Kernel Mode Gadget API						   USB_EP_QUEUE(9)

NAME
usb_ep_queue - queues (submits) an I/O request to an endpoint. SYNOPSIS
int usb_ep_queue(struct usb_ep * ep, struct usb_request * req, gfp_t gfp_flags); ARGUMENTS
ep the endpoint associated with the request req the request being submitted gfp_flags GFP_* flags to use in case the lower level driver couldn't pre-allocate all necessary memory with the request. DESCRIPTION
This tells the device controller to perform the specified request through that endpoint (reading or writing a buffer). When the request completes, including being canceled by usb_ep_dequeue, the request's completion routine is called to return the request to the driver. Any endpoint (except control endpoints like ep0) may have more than one transfer request queued; they complete in FIFO order. Once a gadget driver submits a request, that request may not be examined or modified until it is given back to that driver through the completion callback. Each request is turned into one or more packets. The controller driver never merges adjacent requests into the same packet. OUT transfers will sometimes use data that's already buffered in the hardware. Drivers can rely on the fact that the first byte of the request's buffer always corresponds to the first byte of some USB packet, for both IN and OUT transfers. Bulk endpoints can queue any amount of data; the transfer is packetized automatically. The last packet will be short if the request doesn't fill it out completely. Zero length packets (ZLPs) should be avoided in portable protocols since not all usb hardware can successfully handle zero length packets. (ZLPs may be explicitly written, and may be implicitly written if the request 'zero' flag is set.) Bulk endpoints may also be used for interrupt transfers; but the reverse is not true, and some endpoints won't support every interrupt transfer. (Such as 768 byte packets.) Interrupt-only endpoints are less functional than bulk endpoints, for example by not supporting queueing or not handling buffers that are larger than the endpoint's maxpacket size. They may also treat data toggle differently. Control endpoints ... after getting a setup callback, the driver queues one response (even if it would be zero length). That enables the status ack, after transfering data as specified in the response. Setup functions may return negative error codes to generate protocol stalls. (Note that some USB device controllers disallow protocol stall responses in some cases.) When control responses are deferred (the response is written after the setup callback returns), then usb_ep_set_halt may be used on ep0 to trigger protocol stalls. Depending on the controller, it may not be possible to trigger a status-stage protocol stall when the data stage is over, that is, from within the response's completion routine. For periodic endpoints, like interrupt or isochronous ones, the usb host arranges to poll once per interval, and the gadget driver usually will have queued some data to transfer at that time. Returns zero, or a negative error code. Endpoints that are not enabled report errors; errors will also be reported when the usb peripheral is disconnected. AUTHOR
David Brownell <dbrownell@users.sourceforge.net> Author. COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 USB_EP_QUEUE(9)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy