The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to detect whethere the CD is R or RW jisha Shell Programming and Scripting 2 07-24-2008 01:03 PM
aix telnet disconnects e1lyons AIX 0 10-12-2006 12:55 PM
xterm detect inquirer Shell Programming and Scripting 2 11-27-2002 05:33 PM
How to detect process pkanonwe Shell Programming and Scripting 2 10-18-2002 11:33 AM
Not able to detect nr of cpu in Solaris System pbonato UNIX for Dummies Questions & Answers 1 04-04-2002 10:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-21-2008
pjwhite pjwhite is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
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 that stays up my program continually polls the socket and tries to send a status message. These will never end up failing.

The poll just returns 0 implying a timeout, and the poll before a send returns with a POLLOUT and a send returns the number of bytes I tried to send, implying that it sent properly.

This goes on for ever. I am trying to figure out how to detect that the socket is down so I can clean up my end and listen for the computer to connect again.




Thanks!
PJW
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0