Ping/pong autobahn js option

#1

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So that the client can detect when they have lost connection with the WAMP router. I have found scenarios where the router ping fails and it resets the connection with the client, but the client does not sense that this has occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to the Autobahn Python client here (https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can see that there is a Python setProtocolOptions() with an autoPingInterval which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn JS library? A look thru the docs didnt show it. I also had a look thru the Github issues and didnt see it highlighted as a feature missing. So maybe I am looking in the wrong place?

Many thanks

John

0 Likes

#2

Hi,

the browser API and implementations of WebSocket don't allow to control WebSocket ping/pong.

So when using ABJS on browsers, there is no way we could support that.

https://stackoverflow.com/a/10586583/884770

When using ABJS on NodeJS, we could add such a feature - it is not there currently.

Are you running ABJS on browsers or Node?

Cheers,
/Tobias

···

Am 13.06.2017 um 13:31 schrieb John O'Callaghan:

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So
that the client can detect when they have lost connection with the WAMP
router. I have found scenarios where the router ping fails and it resets
the connection with the client, but the client does not sense that this has
occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to
the Autobahn Python client here
(https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can
see that there is a Python setProtocolOptions() with an autoPingInterval
which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn
JS library? A look thru the docs didnt show it. I also had a look thru the
Github issues and didnt see it highlighted as a feature missing. So maybe I
am looking in the wrong place?

Many thanks
John

0 Likes

#3

Hi Tobias

Thanks for that quick reply. I am using ABJS in Node so could definitely make use of that feature.

Many thanks

John

···

On Tuesday, June 13, 2017 at 1:02:52 PM UTC+1, Tobias Oberstein wrote:

Hi,

the browser API and implementations of WebSocket don’t allow to control
WebSocket ping/pong.

So when using ABJS on browsers, there is no way we could support that.

https://stackoverflow.com/a/10586583/884770

When using ABJS on NodeJS, we could add such a feature - it is not there
currently.

Are you running ABJS on browsers or Node?

Cheers,

/Tobias

Am 13.06.2017 um 13:31 schrieb John O’Callaghan:

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So

that the client can detect when they have lost connection with the WAMP

router. I have found scenarios where the router ping fails and it resets

the connection with the client, but the client does not sense that this has

occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to

the Autobahn Python client here

(https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can

see that there is a Python setProtocolOptions() with an autoPingInterval

which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn

JS library? A look thru the docs didnt show it. I also had a look thru the

Github issues and didnt see it highlighted as a feature missing. So maybe I

am looking in the wrong place?

Many thanks

John

0 Likes

#4

Hi Tobias

Just wanted to run by you my plan to implement my own ping for now to see if it will align in any way with what you guys might release in the future.

Plan will be to use the publish/acknowledge API and periodically send a “ping” event to a “heartbeat” topic. If I don’t receive an acknowledge within a timeout period then I will assume the connection has been lost and close everything down.

Seem like a fair enough solution?

Thanks again for your time

John

···

On Tuesday, June 13, 2017 at 1:54:25 PM UTC+1, John O’Callaghan wrote:

Hi Tobias

Thanks for that quick reply. I am using ABJS in Node so could definitely make use of that feature.

Many thanks

John

On Tuesday, June 13, 2017 at 1:02:52 PM UTC+1, Tobias Oberstein wrote:

Hi,

the browser API and implementations of WebSocket don’t allow to control
WebSocket ping/pong.

So when using ABJS on browsers, there is no way we could support that.

https://stackoverflow.com/a/10586583/884770

When using ABJS on NodeJS, we could add such a feature - it is not there
currently.

Are you running ABJS on browsers or Node?

Cheers,

/Tobias

Am 13.06.2017 um 13:31 schrieb John O’Callaghan:

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So

that the client can detect when they have lost connection with the WAMP

router. I have found scenarios where the router ping fails and it resets

the connection with the client, but the client does not sense that this has

occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to

the Autobahn Python client here

(https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can

see that there is a Python setProtocolOptions() with an autoPingInterval

which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn

JS library? A look thru the docs didnt show it. I also had a look thru the

Github issues and didnt see it highlighted as a feature missing. So maybe I

am looking in the wrong place?

Many thanks

John

0 Likes

#5

Hi John,

that is probably the best solution there is for the time being.

Regards,

Alex

···

Am Dienstag, 13. Juni 2017 15:31:32 UTC+2 schrieb John O’Callaghan:

Hi Tobias

Just wanted to run by you my plan to implement my own ping for now to see if it will align in any way with what you guys might release in the future.

Plan will be to use the publish/acknowledge API and periodically send a “ping” event to a “heartbeat” topic. If I don’t receive an acknowledge within a timeout period then I will assume the connection has been lost and close everything down.

Seem like a fair enough solution?

Thanks again for your time

John

On Tuesday, June 13, 2017 at 1:54:25 PM UTC+1, John O’Callaghan wrote:

Hi Tobias

Thanks for that quick reply. I am using ABJS in Node so could definitely make use of that feature.

Many thanks

John

On Tuesday, June 13, 2017 at 1:02:52 PM UTC+1, Tobias Oberstein wrote:

Hi,

the browser API and implementations of WebSocket don’t allow to control
WebSocket ping/pong.

So when using ABJS on browsers, there is no way we could support that.

https://stackoverflow.com/a/10586583/884770

When using ABJS on NodeJS, we could add such a feature - it is not there
currently.

Are you running ABJS on browsers or Node?

Cheers,

/Tobias

Am 13.06.2017 um 13:31 schrieb John O’Callaghan:

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So

that the client can detect when they have lost connection with the WAMP

router. I have found scenarios where the router ping fails and it resets

the connection with the client, but the client does not sense that this has

occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to

the Autobahn Python client here

(https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can

see that there is a Python setProtocolOptions() with an autoPingInterval

which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn

JS library? A look thru the docs didnt show it. I also had a look thru the

Github issues and didnt see it highlighted as a feature missing. So maybe I

am looking in the wrong place?

Many thanks

John

0 Likes

#6

Thanks Alex, will run with that for now.

···

On Tuesday, June 13, 2017 at 4:55:24 PM UTC+1, Alexander Gödde wrote:

Hi John,

that is probably the best solution there is for the time being.

Regards,

Alex

Am Dienstag, 13. Juni 2017 15:31:32 UTC+2 schrieb John O’Callaghan:

Hi Tobias

Just wanted to run by you my plan to implement my own ping for now to see if it will align in any way with what you guys might release in the future.

Plan will be to use the publish/acknowledge API and periodically send a “ping” event to a “heartbeat” topic. If I don’t receive an acknowledge within a timeout period then I will assume the connection has been lost and close everything down.

Seem like a fair enough solution?

Thanks again for your time

John

On Tuesday, June 13, 2017 at 1:54:25 PM UTC+1, John O’Callaghan wrote:

Hi Tobias

Thanks for that quick reply. I am using ABJS in Node so could definitely make use of that feature.

Many thanks

John

On Tuesday, June 13, 2017 at 1:02:52 PM UTC+1, Tobias Oberstein wrote:

Hi,

the browser API and implementations of WebSocket don’t allow to control
WebSocket ping/pong.

So when using ABJS on browsers, there is no way we could support that.

https://stackoverflow.com/a/10586583/884770

When using ABJS on NodeJS, we could add such a feature - it is not there
currently.

Are you running ABJS on browsers or Node?

Cheers,

/Tobias

Am 13.06.2017 um 13:31 schrieb John O’Callaghan:

Hi all

I am looking for an option to enable ping/pong for autobahn js clients. So

that the client can detect when they have lost connection with the WAMP

router. I have found scenarios where the router ping fails and it resets

the connection with the client, but the client does not sense that this has

occurred and continues to think the connection is still up and alive.

I have found a thread where this scenario has been discussed in relation to

the Autobahn Python client here

(https://groups.google.com/forum/#!topic/autobahnws/wNRjnM8b67w) and I can

see that there is a Python setProtocolOptions() with an autoPingInterval

which has been recommended as the preferred solution.

My question: Is there a similar connectionOption available for the Autobahn

JS library? A look thru the docs didnt show it. I also had a look thru the

Github issues and didnt see it highlighted as a feature missing. So maybe I

am looking in the wrong place?

Many thanks

John

0 Likes