Skip to main content
1-Visitor
April 7, 2016
Solved

How to keep EMS/Java alive without any Pings

  • April 7, 2016
  • 1 reply
  • 3660 views

Hi,

I would like to keep Remote thing alive more than 55 sec (at least 1 hour ~ 1 day) without any PINGs.

How can I realize this feature?

I tried set...

EMS#pingRate: 300000 (5 mins)

WSCommunicationsSubsystem#Idle Connection Timeout: 3600 (1 hour)

but for each time EMS pings to the PF, WSConnection closes by error and Re-Connect attempt occurs.

Regards,

S.Yamabe

Best answer by Aanjan

駿介 山辺, can you try changing/ increasing your idle ping rate on the WSCommunicationSubsystem as well? I believe it is set to 45 seconds by default.

1 reply

Aanjan5-Regular MemberAnswer
5-Regular Member
April 7, 2016

駿介 山辺, can you try changing/ increasing your idle ping rate on the WSCommunicationSubsystem as well? I believe it is set to 45 seconds by default.

1-Visitor
April 7, 2016

as suggested, and made these settings on the platform:

Websocket Communication Settings

Idle Connection Timeout (sec)

3660

Idle Ping Rate (secs)

1260

Amount of time to wait for authentication message (secs)

61

Amount of time a request will wait for the response message before timing out (secs)

61

Asynchronous edge dispatching configuration

Max Thread Count

10

Client Endpoints

Endpoint Name    Endpoint URI    Max Endpoint Connections    Idle Ping Rate (secs)    Application Key

however on my java ems side, I still see a pong happening every 45 seconds,

What do I need to do on the ems side to bind to the platform settings?

03:00:38.839 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 779616668] PONG has been received

03:01:13.895 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 876343241] Client has been idle, sending websocket ping with timeout 10000 ...

03:01:13.895 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=9 length=0

03:01:13.957 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=10

03:01:13.957 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0

03:01:23.903 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 1289720563] PONG has been received

03:01:58.957 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 876343241] Client has been idle, sending websocket ping with timeout 10000 ...

03:01:58.957 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=9 length=0

03:01:59.017 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=10

03:01:59.017 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0

03:02:08.967 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 750800938] PONG has been received

03:02:44.018 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 876343241] Client has been idle, sending websocket ping with timeout 10000 ...

5-Regular Member
April 7, 2016

Rick, you can set it via the ClientConfigurator class. You can set the idle ping rate and the ping timeout.