[En-Nut-Discussion] Detecting disconnet of the network cable

Wiegelmann, Jörg Joerg.Wiegelmann at ces-tronics.de
Thu Jun 12 14:20:59 CEST 2008


I'm using Ethernut with the EIR-SAM7 Hardware. I got data over a TCP-IP connection. When someone disconnects the network cable at the Ethernutboard, no softwarepart ist recognizing this.  I tried the following implementation, but without success. tcperr doesn't show any error on disconnecting.

 

NutTcpAccept(sockin, PortListen);

NutTcpSetSockOpt(sockin,SO_RCVTIMEO,&ulReceiveTimeout,sizeof(ulReceiveTimeout)); 

do 

 {

   Cnt=NutTcpReceive(sockin,buffer,BUFFER_SIZE);

   tcperr = NutTcpError(sockin);

 }while(tcperr==0);

 

any Idea?

Best regards and thank you

Joerg.

 

 

 

 

 




More information about the En-Nut-Discussion mailing list