WS link broken after 10 minutes or so

Home Forums Report a Bug or Issue WS link broken after 10 minutes or so

This topic contains 5 replies, has 2 voices, and was last updated by  Paul Sumpner 2 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #813

    adreamer
    Participant

    I’m currently developing a “boat server” where I pick up NMEA data sent from iKommunicate for further analysis. I’m using nodejs as framework.
    The problem is that after 10-15 minutes iKommunicate stops sending data over the established ws link. The only way to get data again is to close the ws connection and then reopen it.

    Question: Does it exist any kind of ping/pong procedure in iKommunicate WS implementation?

    #828

    Paul Sumpner
    Keymaster

    Hi Adreamer,

    We have no known issues with web socket stability. Have you tried running either of the hosted web apps that use web sockets (Instrument Panel, iKompass or the Websocket Logger) for long periods?

    It would be good to prove if it is specific to your NodeJS implementation.

    We do not use a Ping/Pong type procedure on iKommunicate, just another thing to create incompatibility. I have been told that some firewalls can cut idle WS connections, but never experienced it myself.

    However when a web app opens a web socket with iKommunicate, it will send a hello message and then even if there is no NMEA0183 or NMEA2000 data being received and therefore no Signal K Delta messages, iKommunicate will send a Signal K “heartbeat” Delta message every second…

    Web Socket Heartbeat

    Hope this answers your question and please come back with anymore questions or feedback on your testing.

    Best regards
    PAUL

    #834

    adreamer
    Participant

    Hi,
    I have tested for a longer period using the hosted Websocket logger app. Unfortunately, the websocket data stream become silent after a while.
    Also, I have rewritten my node app and have tested it with different node modules for websocket connection. The one which are the most stable is ws (look at npm ws).
    After approximately 42500 +/- 2000 messages the link become silent. No messages from iKommunicate, but the link is up and stated as OK seen from the client. When it has been silent for approximately 1,5 minute, I send ws.close() and after received the acknowledge I establish a new connection and everything is OK for the next approximately 42500 websocket messages. I have run this test the past 24 hours, and the link become silent all the time after 42500 +/- 2000 messages.
    So, I think the solution for my sailboat server is to have a routine that verify that there is data on the websocket link; If no data for a couple of minutes then disconnect the connection and establish a new websocket connection
    kind regards
    Svein
    The dreamer and sailor from Norway

    #836

    adreamer
    Participant

    An update.
    Few seconds ago, I checked the status of my NodeJS test app, and during the last round it received 98888 messages before the link became silent. I will let it continue the test during the night and check the log again tomorrow morning.

    #869

    adreamer
    Participant

    Hi again,
    The past days I have performed several tests using different implementation of websocket. All the time I get 40-50k messages before the link become silent, but from time to time I receive close to 100k messages before the link become silent.

    My workaround is to have a small “CheckIfDataStilOnLink” function and if result is false I disconnect and connect the websocket link and everything is fine for the next 40-50k messages.

    Best Regards
    Svein

    #876

    Paul Sumpner
    Keymaster

    Hi Svein,

    Glad you have found a work around, but I will discuss the results you have found with our developers and see if we can track down what is happening.

    I’ll post some more feedback on here ASAP.

    Best regards
    PAUL

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed