cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet etiquette ! Closing ?

T J
Lead
Posted on July 24, 2017 at 02:30

I am new to ethernet, finally running on my private PCB.

I have an industrial scenario, many slaves talking to the master over can-bus, then the master is talking to a server on the cloud.

there will be several masters logged into the same cloud server.

the Master will transmit up to the server every minute, maybe 2K of data.

When should I close a connection ?

the example I have running sends 1 packet and closes the connection.

Should I send the 2K and then close it ?

or just leave it open forever ?

2 REPLIES 2
AvaTar
Lead
Posted on July 24, 2017 at 09:21

Should I send the 2K and then close it ?

 or just leave it open forever ?

Supposedly TCP/IP, then.

Usually, the cloud server (a 'full-blown' TCP/IP stack, I assume) will close the connection after a grace period.

However, I experienced troubles with this lazy approach in the past.

Especially on smaller devices, open connections block resource handles.

In my case, it were file handles on a VxWorks-based device. After several minutes, before the grace period for the first handle expired, all handles were already eaten up, and no new connections accepted.

A recommended read would be the RFC documents for the TCP/IP protocol, the sections about opening/closing connections.

I do not claim very detailed knowledge in this field ...

Posted on July 24, 2017 at 16:35

I will check the document, thanks for the advice.