Sponsored Content
Top Forums Programming can-not detect TCP disconnects well Post 302231871 by mika on Wednesday 3rd of September 2008 10:24:49 AM
Old 09-03-2008
see manpage setsockopt() and pay special attention to so_keepalive and tcp_keepalive or tcp_keepidle options. BTW, options are system specified.
 

10 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. AIX

Telnet disconnects on handheld device AIX

I have intermec handheld device which is connecting to AIX Server on port 12431 or whatever. ( oracle application ) The handheld device connects for few seconds and then disconnects from the AIX server. Once it disconnects the handheld device automatically switches off. Are there any... (2 Replies)
Discussion started by: filosophizer
2 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

How detect TCP/IP socket shutdown when ethernet cable is disconnected

Hi, I want to code TCP/IP client/server in linux application capable to fastly detect ethernet cable disconnection in any condition. So I have activate SO_KEEPALIVE options and set TCP_KEEPCNT, TCP_KEEPIDLE and TCP_KEEPINTVL to 1. When I disconnect ethernet cable I have the following... (5 Replies)
Discussion started by: jeje_clb
5 Replies

5. Programming

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: server: netstat -aveeopT tcp 0 0 *:17398 *:* LISTEN server-user... (8 Replies)
Discussion started by: eoa
8 Replies

6. Programming

[C++] [Unix] TCP non-blocking. Detect server disconnection procedure over, from client.

Hello! I searched forum for similar topic, with no luck, if you know one, delete this topic, and send me private message with link please. Little background: I have a lot of clients and one serwer. Client can make multiple connections on different ports and ips, but only one can be acctive... (2 Replies)
Discussion started by: ikeban
2 Replies

7. 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

8. 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

9. 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

10. 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
GETSOCKOPT(2)						     Linux Programmer's Manual						     GETSOCKOPT(2)

NAME
getsockopt, setsockopt - get and set options on sockets SYNOPSIS
#include <sys/types.h> #include <sys/socket.h> int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); DESCRIPTION
Getsockopt and setsockopt manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost socket level. When manipulating socket options the level at which the option resides and the name of the option must be specified. To manipulate options at the socket level, level is specified as SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of TCP; see getprotoent(3). The parameters optval and optlen are used to access option values for setsockopt. For getsockopt they identify a buffer in which the value for the requested option(s) are to be returned. For getsockopt, optlen is a value-result parameter, initially containing the size of the buffer pointed to by optval, and modified on return to indicate the actual size of the value returned. If no option value is to be sup- plied or returned, optval may be NULL. Optname and any specified options are passed uninterpreted to the appropriate protocol module for interpretation. The include file <sys/socket.h> contains definitions for socket level options, described below. Options at other protocol levels vary in format and name; consult the appropriate entries in section 4 of the manual. Most socket-level options utilize an int parameter for optval. For setsockopt, the parameter should be non-zero to enable a boolean option, or zero if the option is to be disabled. For a description of the available socket options see socket(7) and the appropriate protocol man pages. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EBADF The argument s is not a valid descriptor. ENOTSOCK The argument s is a file, not a socket. ENOPROTOOPT The option is unknown at the level indicated. EFAULT The address pointed to by optval is not in a valid part of the process address space. For getsockopt, this error may also be returned if optlen is not in a valid part of the process address space. CONFORMING TO
SVr4, 4.4BSD (these system calls first appeared in 4.2BSD). SVr4 documents additional ENOMEM and ENOSR error codes, but does not document the SO_SNDLOWAT, SO_RCVLOWAT, SO_SNDTIMEO, SO_RCVTIMEO options NOTE
The fifth argument of getsockopt and setsockopt is in reality an int [*] (and this is what BSD 4.* and libc4 and libc5 have). Some POSIX confusion resulted in the present socklen_t. The draft standard has not been adopted yet, but glibc2 already follows it and also has socklen_t [*]. See also accept(2). BUGS
Several of the socket options should be handled at lower levels of the system. SEE ALSO
ioctl(2), socket(2), getprotoent(3), protocols(5), socket(7), unix(7), tcp(7) Linux Man Page 1999-05-24 GETSOCKOPT(2)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy