Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 19-02-2020, 03:18   #1
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Setting TCP timeout before a new connection is created

Hopefully someone can help me with this. I've notice that OpenCPN closes the TCP port and opens a new one if it does not see any NMEA sentences within about 30 seconds. Is there anywhere I can configure that timeout and increase it to what I need. This behavour is causing some of the NMEA feed devices I use to fall over because too many sockets have been opened. TIA.
__________________

Kipper1258 is offline   Reply With Quote
Old 19-02-2020, 06:33   #2
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,093
Re: Setting TCP timeout before a new connection is created

Quote:
Originally Posted by Kipper1258 View Post
Hopefully someone can help me with this. I've notice that OpenCPN closes the TCP port and opens a new one if it does not see any NMEA sentences within about 30 seconds. Is there anywhere I can configure that timeout and increase it to what I need. This behavour is causing some of the NMEA feed devices I use to fall over because too many sockets have been opened. TIA.
It is a hard coded 5 second timer. If no data is received for 1 second then a counter is decremented. It starts at 5 and when the counter hits zero then O closes the socket and waits about 5 seconds and tries to reopen the connection.

It would not be hard to make both of these values a setting in the configuration file. Submit a flyspray enhancement request and try to describe in detail what you need and why it is important.

But really, these other devices you describe are technically "broken". They should also have timeouts on their connections and close them so the sockets can be reused. So it appears you are asking for a bandaid and perhaps the best medicine is to get these other devices to behave properly.
__________________

transmitterdan is offline   Reply With Quote
Old 19-02-2020, 15:47   #3
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Re: Setting TCP timeout before a new connection is created

Thanks for this. Is the 1-5 seconds for any form of data on the port, or only useful NMEA sent? I do need to check how the NMEA server on board is configured as it is the first time we have sailed the boat with an NMEA feed from a 2004 Silva-Nexus server.
Kipper1258 is offline   Reply With Quote
Old 19-02-2020, 21:56   #4
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,093
Re: Setting TCP timeout before a new connection is created

It does not check for a full and proper NMEA message. The watch dog starts again after receiving a chunk of data over the TCP connection.
transmitterdan is offline   Reply With Quote
Old 20-02-2020, 02:49   #5
Registered User

Join Date: Apr 2013
Location: Brisbane, Australia
Posts: 6
Images: 1
Re: Setting TCP timeout before a new connection is created

Quote:
Originally Posted by transmitterdan View Post
The watch dog starts again after receiving a chunk of data over the TCP connection.
Excellent! I'm using a USR-W600 to convert the serial signal into WiFi. It has a heartbeat function where I can configure the data sent and frequency. My backup if I cannot sort out the Nexus server calibration. Thanks once again for your help.
Kipper1258 is offline   Reply With Quote
Reply

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 Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming connection ports in setting? Franziska OpenCPN 4 13-09-2016 05:35
GPS timeout value? Andreas29 OpenCPN 6 24-05-2016 09:55
TCP Connection via WIFI for Raymarine HybridTouch Dockhead Marine Electronics 3 20-03-2016 17:51
Making a TCP/IP Connection Glen96 OpenCPN 7 18-11-2014 20:10

Advertise Here


All times are GMT -7. The time now is 20:56.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.