Sponsored Content
Top Forums Programming How detect TCP/IP socket shutdown when ethernet cable is disconnected Post 302435674 by jeje_clb on Thursday 8th of July 2010 02:03:20 AM
Old 07-08-2010
Hi gratuitous_arp

SIOCETHTOOL ioctl command allow to know is physical connection is present.

I my case, I have physical connection with a switch but the connection between the distant equipment will be broken during exchange. So, the TCP acknowledge will not be receive, TCP request will be resend as soon as tcp_retry is reach. After these retry, even if I have asked to send more data with the send command, no more data will be send from my computer to the distant computer (no more traces with tcpdump). After about 15 minutes, the recv command return with error "no route to host". But, I wanted to detect the socket disconnection after some secondes.

If you have any other idea, don't hesitate to propose it.

Regards
 

10 More Discussions You Might Find Interesting

1. Solaris

Monitor displays Cable disconnected

Hi all This is my first post in this forums. I hope some one can help me with this my Sun Ultra 60 worked fine couple of months back when i used a dell (1280x1024). i move to a MN last month n bought a new sony monitor with (1280x1024) but when i connect it to the box it monitor displays... (1 Reply)
Discussion started by: venuavula
1 Replies

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

3. Red Hat

[RHEL4.5] server shutdown when I unplug the ethernet cable

hi.. I unplug my eth0 lan cable.. and suddenly my system shutdown... no idea :eek::confused: (3 Replies)
Discussion started by: flekzout
3 Replies

4. IP Networking

How to handle unplugging ethernet cable in socket programming

Hi, I am trying to implement a server-client socket communication. My server and clients are in different PCs. During communications if the ethernet cable is removed from the server side it shows broken pipe due to unable to write on the socket. I want to know how to check whether the ethernet... (0 Replies)
Discussion started by: JagadishB
0 Replies

5. IP Networking

Two Servers via ethernet crossover cable

Hi, I'm trying to communicate two servers (HP DLProliant 380 G5) via a crossover cable, but I don't get them to ping each other. I am working in RHEL 4. These are the steps I've performed: 1) Plugged the crossover cables in eth2. (note: The cable is brand new. Also I built one myself... (3 Replies)
Discussion started by: jrodriguez365
3 Replies

6. UNIX for Dummies Questions & Answers

How to change ethernet cable of iscsi initiator (iscsi client)?

how to change ethernet cable of iscsi initiator (iscsi client) (0 Replies)
Discussion started by: pankajd
0 Replies

7. AIX

How to detect the network cable status with c programming on AIX

Hello, Is there any API or any other approach to detect whether the network cable is connected to the network adapter, say, en0, en1 or en2? The OS is AIX6.1. Thank you. (4 Replies)
Discussion started by: zephyrbj
4 Replies

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

9. IP Networking

Packets sent from Linux TCP socket

Hello, Our software is using a TCP socket (AF_INET, SOCK_STREAM) to communicate with an Ethernet device. When we send a message, the message object writes itself in full onto the socket's stream buffer before the software invokes send() from socket.h. I'm still researching, but have 2... (1 Reply)
Discussion started by: bix_20002000
1 Replies

10. IP Networking

Detect Socket timeout in tcpdump capture

Hello, I detect these errors in my logs : Socket timeout calling url http://server:port/bla/soap/selfcare/infoRapide] Unable to make proxyRequest I've made a tcpdump capture this way : tcpdump -i eth0 -s 0 -w /app/captura.pcap port 8080 But I'm fairly new in reading .pcap files with... (0 Replies)
Discussion started by: black_fender
0 Replies
shutdown(2)							System Calls Manual						       shutdown(2)

NAME
shutdown() - shut down a socket SYNOPSIS
DESCRIPTION
The system call is used to shut down a socket. In the case of a full-duplex connection, can be used to either partially or fully shut down the socket, depending upon the value of how. how Interpretation Further receives are disallowed Further sends are disallowed Further sends and receives are disallowed The s parameter is a socket descriptor for the socket to be shut down. Once the socket has been shut down for receives, all further calls return an end-of-file condition. A socket that has been shut down for sending causes further calls to return an error and send the signal. After a socket has been fully shut down, operations other than and return appropriate errors, and the only other thing that can be done to the socket is a Multiple shutdowns on a connected socket and shutdowns on a socket that is not connected may not return errors. A on a connectionless socket, such as only marks the socket as unable to do further or calls, depending upon the value of how. Once this type of socket has been disabled for both sending and receiving data, it becomes fully shut down. For sockets, if how is or the connection begins to be closed gracefully in addition to the normal actions. However, the call does not wait for the completion of the graceful dis- connection. The disconnection is complete when both sides of the connection have done a with how equal to or Once the connection has been completely terminated, the socket becomes fully shut down. The option (see socket(2)) does not have any meaning for the call, but does for the call. For more information on how the call interacts with sockets, see socket(2). If a is performed on a socket that has a pending on it, that socket becomes fully shut down when how AF_CCITT only The how parameter behaves differently if the socket is of the address family. If how is set to the specified socket can no longer receive data. The SVC is not cleared and remains intact. However, if data is subsequently received on the SVC, it is cleared. The connection is not completely down until either side executes a or with how set to or If how is set to or the SVC can no longer send or receive data and the SVC is cleared. The socket's resources are maintained so that data arriving prior to the call can still be read. SCTP Only: SCTP differs from TCP in that SCTP does not have half closed semantics. Hence the call for SCTP is an approximation of the TCP call and solves some different problems. Full TCP-compatibility is not provided, so developers porting TCP applications to SCTP may need to re-code sections that use You can achieve the same results as half closed semantics in SCTP by using SCTP streams. These are the possible SCTP operations: Disables further receive operations. No SCTP protocol action is taken. Disables further send operations and initiates the SCTP shutdown sequence. Disables further send and receive operations and initiates the SCTP shutdown sequence. The major difference between SCTP and TCP is that SCTP initiates immediate and full protocol shutdown, whereas TCP causes TCP to go into the half closed state. behaves the same for SCTP as TCP. The purpose of SCTP is to close the SCTP association while still leaving the socket descriptor open, so that the caller can receive back any data SCTP was unable to deliver. Note: SCTP is only available when the SCTP optional bundle is installed. X/Open Sockets Compilation Environment See xopen_networking(7). RETURN VALUE
Upon successful completion, returns 0; otherwise it returns -1 and is set to indicate the error. ERRORS
fails if any of the following conditions are encountered: s is not a valid file descriptor. The remote system or an intermediate system in the communications path does not support a protocol option sent by the local system. This option may have been set using a or call, or set as a system parameter. s is a valid file descriptor, but it is not a socket. The specified socket is not connected. The specified socket is not connected. The how argument is invalid. WARNINGS
Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex- pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy. FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati- ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network- ing(7)). AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
close(2), connect(2), socket(2), sctp(7), xopen_networking(7). STANDARDS CONFORMANCE
shutdown(2)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy