Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Manage socket during cable disconnection: (3 Items)
   
Manage socket during cable disconnection  
Hi

I have to manage the case of the cable disconnection. Then it occured the "send" function work a little time (buffer 
filling) then the "send" function block during a very long time out (many minutes).

Is there a way to detect this case (cable disconnection) ?
Is there a way to manage this timeout ?

Thank 

Olivier
Re: Manage socket during cable disconnection  
If you just want to look at the link state of the node then it is reported by ifconfig and can be fetched 
programatically by doing a SIOCGIFDATA and looking at the ifdata.ifdr_data.ifi_link_state
N.B. This only reports the node link state, if the path between the two TCP endpoints is broken somewhere in the middle 
then the node link state may still be up.

I think what you are actually looking for is the TCP Keepalive mechanism, please see our documentation and example code 
for it:
http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.neutrino.lib_ref%2Ftopic%2Fg%2Fgetsockopt.html&
anchor=getsockopt__Keepalive
Re: Manage socket during cable disconnection  
Thank for your reply
I ll try this

Olivier