[En-Nut-Discussion] Network Link state on at91_emac and others

Ole Reinhardt ole.reinhardt at embedded-it.de
Tue Sep 16 10:00:00 CEST 2008


Hi!

> Well, I agree to some extent. Perhaps a cable disconnect should
> trigger the timeout counter and droping the sockets when it reaches
> zero is the safest thing to do. On the other hand if cable is
> reinserted before that, then do nothing.

To some extend I would agree too. But in which case a disconnection will
occur? It will mostly occur when either a power failure or failure of
the next router / switch / device will happen. In this case the timeout
will occur very likely. If someone just disconnect the device for a
short while it is quite likely that he either connected the device to a
different network or he is doing some service stuff. In this case it
will take longer too.

> Consider that on a connection, the PC sends data soon after the cable
> is disconnected on the nut box. The PC will eventually timeout and
> drop the connection,

The PC will mostly drop the connection just in the moment of
disconnection as most OSes behave like this.

>  and when the cable is reinserted to the nut box,
> it will not see any of the transmission attempts form the PC and might
> be stuck in the NutTcpReceive beliving the connection is still open.
> In this state the PC box can't even reestablish the connection if the
> nut application isn't threaded in a maner similar to the HTTP example.
> If done multiple times, the socket descriptors will also run out even
> on the HTTP example and we will end up with an unresponsive nut box
> until NutTcpReceive times out, if it has any timeout.

Fully agree. That's why I don't see having a timeout or even holding the
sockets is a good idea.

Regards,

Ole Reinhardt

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list