WebSocket connection can't reconnect after some time












0















I wrote some logic which represent near 200 websocet connection with exchange at the same time.I use third party api and it based on org.eclipse.jetty.websocket.api. I have this method which i had to override.



try {
URI uri = new URI(websocketBaseUrl + url);
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setTrustAll(true);
WebSocketClient client = new WebSocketClient(sslContextFactory);
client.setMaxIdleTimeout(0);
client.start();
return client.connect(adapter, uri).get();
} catch (URISyntaxException e) {
throw new BinanceApiException("URL Syntax error: " + e.getMessage());
} catch (Throwable e) {
throw new BinanceApiException("Websocket error: " + e.getMessage());
}


I added setIdleTimeout to it so that the connection is not lost when i don't recieve information for a long time.
Exchange close connection one time a day but for 2,3 sometimes 4 days it have been reconnected.But finally i get this:




java.nio.channels.ClosedChannelException: null at
org.eclipse.jetty.io.WriteFlusher.onClose(WriteFlusher.java:507) at
org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onIncompleteFlush(SslConnection.java:527)
at
org.eclipse.jetty.io.AbstractEndPoint$2.onIncompleteFlush(AbstractEndPoint.java:54)
at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:331) at
org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:372)
at
org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.flush(FrameFlusher.java:153)
at
org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.process(FrameFlusher.java:217)
at
org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
at
org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
at
org.eclipse.jetty.websocket.common.io.FrameFlusher.enqueue(FrameFlusher.java:382)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:614)
at
org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onConnectionStateChange(AbstractWebSocketConnection.java:473)
at
org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
at
org.eclipse.jetty.websocket.common.io.IOState.onReadFailure(IOState.java:498)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:666)
at
org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
at
org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:289)
at
org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:149)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
at
org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
at java.lang.Thread.run(Thread.java:748)




I find this question on stackoverflow but i can't see clear answer. Pls help.Thanks in advance.










share|improve this question





























    0















    I wrote some logic which represent near 200 websocet connection with exchange at the same time.I use third party api and it based on org.eclipse.jetty.websocket.api. I have this method which i had to override.



    try {
    URI uri = new URI(websocketBaseUrl + url);
    SslContextFactory sslContextFactory = new SslContextFactory();
    sslContextFactory.setTrustAll(true);
    WebSocketClient client = new WebSocketClient(sslContextFactory);
    client.setMaxIdleTimeout(0);
    client.start();
    return client.connect(adapter, uri).get();
    } catch (URISyntaxException e) {
    throw new BinanceApiException("URL Syntax error: " + e.getMessage());
    } catch (Throwable e) {
    throw new BinanceApiException("Websocket error: " + e.getMessage());
    }


    I added setIdleTimeout to it so that the connection is not lost when i don't recieve information for a long time.
    Exchange close connection one time a day but for 2,3 sometimes 4 days it have been reconnected.But finally i get this:




    java.nio.channels.ClosedChannelException: null at
    org.eclipse.jetty.io.WriteFlusher.onClose(WriteFlusher.java:507) at
    org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onIncompleteFlush(SslConnection.java:527)
    at
    org.eclipse.jetty.io.AbstractEndPoint$2.onIncompleteFlush(AbstractEndPoint.java:54)
    at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:331) at
    org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:372)
    at
    org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.flush(FrameFlusher.java:153)
    at
    org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.process(FrameFlusher.java:217)
    at
    org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
    at
    org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
    at
    org.eclipse.jetty.websocket.common.io.FrameFlusher.enqueue(FrameFlusher.java:382)
    at
    org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:614)
    at
    org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72)
    at
    org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onConnectionStateChange(AbstractWebSocketConnection.java:473)
    at
    org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
    at
    org.eclipse.jetty.websocket.common.io.IOState.onReadFailure(IOState.java:498)
    at
    org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:666)
    at
    org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511)
    at
    org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
    at
    org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:289)
    at
    org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:149)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
    at
    org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    at
    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
    at
    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
    at
    org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    at
    org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
    at
    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
    at
    org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
    at java.lang.Thread.run(Thread.java:748)




    I find this question on stackoverflow but i can't see clear answer. Pls help.Thanks in advance.










    share|improve this question



























      0












      0








      0








      I wrote some logic which represent near 200 websocet connection with exchange at the same time.I use third party api and it based on org.eclipse.jetty.websocket.api. I have this method which i had to override.



      try {
      URI uri = new URI(websocketBaseUrl + url);
      SslContextFactory sslContextFactory = new SslContextFactory();
      sslContextFactory.setTrustAll(true);
      WebSocketClient client = new WebSocketClient(sslContextFactory);
      client.setMaxIdleTimeout(0);
      client.start();
      return client.connect(adapter, uri).get();
      } catch (URISyntaxException e) {
      throw new BinanceApiException("URL Syntax error: " + e.getMessage());
      } catch (Throwable e) {
      throw new BinanceApiException("Websocket error: " + e.getMessage());
      }


      I added setIdleTimeout to it so that the connection is not lost when i don't recieve information for a long time.
      Exchange close connection one time a day but for 2,3 sometimes 4 days it have been reconnected.But finally i get this:




      java.nio.channels.ClosedChannelException: null at
      org.eclipse.jetty.io.WriteFlusher.onClose(WriteFlusher.java:507) at
      org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onIncompleteFlush(SslConnection.java:527)
      at
      org.eclipse.jetty.io.AbstractEndPoint$2.onIncompleteFlush(AbstractEndPoint.java:54)
      at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:331) at
      org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:372)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.flush(FrameFlusher.java:153)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.process(FrameFlusher.java:217)
      at
      org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
      at
      org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher.enqueue(FrameFlusher.java:382)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:614)
      at
      org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onConnectionStateChange(AbstractWebSocketConnection.java:473)
      at
      org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
      at
      org.eclipse.jetty.websocket.common.io.IOState.onReadFailure(IOState.java:498)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:666)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511)
      at
      org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
      at
      org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:289)
      at
      org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:149)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
      at
      org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
      at
      org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
      at java.lang.Thread.run(Thread.java:748)




      I find this question on stackoverflow but i can't see clear answer. Pls help.Thanks in advance.










      share|improve this question
















      I wrote some logic which represent near 200 websocet connection with exchange at the same time.I use third party api and it based on org.eclipse.jetty.websocket.api. I have this method which i had to override.



      try {
      URI uri = new URI(websocketBaseUrl + url);
      SslContextFactory sslContextFactory = new SslContextFactory();
      sslContextFactory.setTrustAll(true);
      WebSocketClient client = new WebSocketClient(sslContextFactory);
      client.setMaxIdleTimeout(0);
      client.start();
      return client.connect(adapter, uri).get();
      } catch (URISyntaxException e) {
      throw new BinanceApiException("URL Syntax error: " + e.getMessage());
      } catch (Throwable e) {
      throw new BinanceApiException("Websocket error: " + e.getMessage());
      }


      I added setIdleTimeout to it so that the connection is not lost when i don't recieve information for a long time.
      Exchange close connection one time a day but for 2,3 sometimes 4 days it have been reconnected.But finally i get this:




      java.nio.channels.ClosedChannelException: null at
      org.eclipse.jetty.io.WriteFlusher.onClose(WriteFlusher.java:507) at
      org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onIncompleteFlush(SslConnection.java:527)
      at
      org.eclipse.jetty.io.AbstractEndPoint$2.onIncompleteFlush(AbstractEndPoint.java:54)
      at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:331) at
      org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:372)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.flush(FrameFlusher.java:153)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher$Flusher.process(FrameFlusher.java:217)
      at
      org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
      at
      org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224)
      at
      org.eclipse.jetty.websocket.common.io.FrameFlusher.enqueue(FrameFlusher.java:382)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:614)
      at
      org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onConnectionStateChange(AbstractWebSocketConnection.java:473)
      at
      org.eclipse.jetty.websocket.common.io.IOState.notifyStateListeners(IOState.java:184)
      at
      org.eclipse.jetty.websocket.common.io.IOState.onReadFailure(IOState.java:498)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:666)
      at
      org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511)
      at
      org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
      at
      org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:289)
      at
      org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:149)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
      at
      org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
      at
      org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
      at
      org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
      at java.lang.Thread.run(Thread.java:748)




      I find this question on stackoverflow but i can't see clear answer. Pls help.Thanks in advance.







      java websocket jetty






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 '18 at 20:48









      Joakim Erdfelt

      32.6k45795




      32.6k45795










      asked Nov 26 '18 at 1:09









      Vlad CheremisinVlad Cheremisin

      164




      164
























          1 Answer
          1






          active

          oldest

          votes


















          1














          If you want the connection to stay open if idle, you should configure your client this way:



          client.setMaxIdleTimeout(Long.MAX_VALUE);


          Setting maxIdleTimeout to 0 would have the opposite effect: Closing the connection as soon as it becomes idle.






          share|improve this answer


























          • I'll try it.Thanks.

            – Vlad Cheremisin
            Nov 26 '18 at 11:00






          • 1





            Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

            – Joakim Erdfelt
            Nov 26 '18 at 19:44











          • Thanks.Now it's clear enough

            – Vlad Cheremisin
            Nov 27 '18 at 9:12











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473604%2fwebsocket-connection-cant-reconnect-after-some-time%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          If you want the connection to stay open if idle, you should configure your client this way:



          client.setMaxIdleTimeout(Long.MAX_VALUE);


          Setting maxIdleTimeout to 0 would have the opposite effect: Closing the connection as soon as it becomes idle.






          share|improve this answer


























          • I'll try it.Thanks.

            – Vlad Cheremisin
            Nov 26 '18 at 11:00






          • 1





            Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

            – Joakim Erdfelt
            Nov 26 '18 at 19:44











          • Thanks.Now it's clear enough

            – Vlad Cheremisin
            Nov 27 '18 at 9:12
















          1














          If you want the connection to stay open if idle, you should configure your client this way:



          client.setMaxIdleTimeout(Long.MAX_VALUE);


          Setting maxIdleTimeout to 0 would have the opposite effect: Closing the connection as soon as it becomes idle.






          share|improve this answer


























          • I'll try it.Thanks.

            – Vlad Cheremisin
            Nov 26 '18 at 11:00






          • 1





            Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

            – Joakim Erdfelt
            Nov 26 '18 at 19:44











          • Thanks.Now it's clear enough

            – Vlad Cheremisin
            Nov 27 '18 at 9:12














          1












          1








          1







          If you want the connection to stay open if idle, you should configure your client this way:



          client.setMaxIdleTimeout(Long.MAX_VALUE);


          Setting maxIdleTimeout to 0 would have the opposite effect: Closing the connection as soon as it becomes idle.






          share|improve this answer















          If you want the connection to stay open if idle, you should configure your client this way:



          client.setMaxIdleTimeout(Long.MAX_VALUE);


          Setting maxIdleTimeout to 0 would have the opposite effect: Closing the connection as soon as it becomes idle.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 27 '18 at 6:50

























          answered Nov 26 '18 at 6:21









          frenchoverflowfrenchoverflow

          964




          964













          • I'll try it.Thanks.

            – Vlad Cheremisin
            Nov 26 '18 at 11:00






          • 1





            Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

            – Joakim Erdfelt
            Nov 26 '18 at 19:44











          • Thanks.Now it's clear enough

            – Vlad Cheremisin
            Nov 27 '18 at 9:12



















          • I'll try it.Thanks.

            – Vlad Cheremisin
            Nov 26 '18 at 11:00






          • 1





            Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

            – Joakim Erdfelt
            Nov 26 '18 at 19:44











          • Thanks.Now it's clear enough

            – Vlad Cheremisin
            Nov 27 '18 at 9:12

















          I'll try it.Thanks.

          – Vlad Cheremisin
          Nov 26 '18 at 11:00





          I'll try it.Thanks.

          – Vlad Cheremisin
          Nov 26 '18 at 11:00




          1




          1





          Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

          – Joakim Erdfelt
          Nov 26 '18 at 19:44





          Setting the Max IdleTimeout to Long.MAX_VALUE is only going to keep Jetty's WebSocketClient from closing the connection. Other players in the network stack could close the connection on their own idle timeout configuration. (eg: the jvm network stack, the os network stack, the network itself, the http intermediaries, the remote network stack, the remote network server configuration, the remote websocket endpoint configuration, etc...)

          – Joakim Erdfelt
          Nov 26 '18 at 19:44













          Thanks.Now it's clear enough

          – Vlad Cheremisin
          Nov 27 '18 at 9:12





          Thanks.Now it's clear enough

          – Vlad Cheremisin
          Nov 27 '18 at 9:12


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53473604%2fwebsocket-connection-cant-reconnect-after-some-time%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Lallio

          Unable to find Lightning Node

          Futebolista