Web Sockets Ping

#1

Hi, I’ve been looking into this group and other sources (like stackoverflow) related to this library and the option of sending the Ping/Pong feature from Web Socket with no luck. I found that WebSocketWritter does have the method to send a Message.Ping, but this is not accessible through WebSocketClient.

Does Autobahn handle automatically Ping/Pong? How can we send Pings if we need to?

Thanks.

0 Likes

#2

My apologize, I forgot to mention that I’m using the Android Lib.

-f

···

On Wednesday, September 26, 2012 10:45:17 PM UTC-6, Franklin Garcia wrote:

Hi, I’ve been looking into this group and other sources (like stackoverflow) related to this library and the option of sending the Ping/Pong feature from Web Socket with no luck. I found that WebSocketWritter does have the method to send a Message.Ping, but this is not accessible through WebSocketClient.

Does Autobahn handle automatically Ping/Pong? How can we send Pings if we need to?

Thanks.

0 Likes

#3

Hi,

AutobahnAndroid automatically responds to received Pings with Pongs.

A planned feature is having an option to do active heartbeating with
Pings so keep a (mobile) connection alive and for fast recognition of
connection losses.

The WebSocketWriter class (obviously) already implements sending Pings
and Pongs, and it would be trivial to expose that to the application.

I am not sure if thats good design though, since the idea is to mimick
the WebSocket API thats available in browsers - and you cannot send
Pings from JavaScript in browsers.

Whats your use case?

Cheers,
Tobias

···

Am 27.09.2012 06:45, schrieb Franklin Garcia:

Hi, I've been looking into this group and other sources (like
stackoverflow) related to this library and the option of sending the
Ping/Pong feature from Web Socket with no luck. I found that
WebSocketWritter does have the method to send a Message.Ping, but this
is not accessible through WebSocketClient.

Does Autobahn handle automatically Ping/Pong? How can we send Pings if
we need to?

Thanks.

0 Likes

#4

That’s exactly what we need to do. Send pings every period of time so we can know if the connections is still alive. We are building a chat application, and sometimes messages are not delivered. We have another team working on an iOS version, and they solved the issue sending pings actively.

-f

···

On Thursday, September 27, 2012 1:09:31 AM UTC-6, Tobias Oberstein wrote:

Am 27.09.2012 06:45, schrieb Franklin Garcia:

Hi, I’ve been looking into this group and other sources (like

stackoverflow) related to this library and the option of sending the

Ping/Pong feature from Web Socket with no luck. I found that

WebSocketWritter does have the method to send a Message.Ping, but this

is not accessible through WebSocketClient.

Does Autobahn handle automatically Ping/Pong? How can we send Pings if

we need to?

Thanks.

Hi,

AutobahnAndroid automatically responds to received Pings with Pongs.

A planned feature is having an option to do active heartbeating with

Pings so keep a (mobile) connection alive and for fast recognition of

connection losses.

The WebSocketWriter class (obviously) already implements sending Pings

and Pongs, and it would be trivial to expose that to the application.

I am not sure if thats good design though, since the idea is to mimick

the WebSocket API thats available in browsers - and you cannot send

Pings from JavaScript in browsers.

Whats your use case?

Cheers,

Tobias

0 Likes

#5

we fixed it by wrting an application level Heart beat… send a HB message over websocket(using sebdmesage()) to the server) and if you don’t get a response, just drop and recreate the conn.

···

On Thursday, September 27, 2012 8:04:04 PM UTC+5:30, Franklin Garcia wrote:

That’s exactly what we need to do. Send pings every period of time so we can know if the connections is still alive. We are building a chat application, and sometimes messages are not delivered. We have another team working on an iOS version, and they solved the issue sending pings actively.

-f

On Thursday, September 27, 2012 1:09:31 AM UTC-6, Tobias Oberstein wrote:

Am 27.09.2012 06:45, schrieb Franklin Garcia:

Hi, I’ve been looking into this group and other sources (like

stackoverflow) related to this library and the option of sending the

Ping/Pong feature from Web Socket with no luck. I found that

WebSocketWritter does have the method to send a Message.Ping, but this

is not accessible through WebSocketClient.

Does Autobahn handle automatically Ping/Pong? How can we send Pings if

we need to?

Thanks.

Hi,

AutobahnAndroid automatically responds to received Pings with Pongs.

A planned feature is having an option to do active heartbeating with

Pings so keep a (mobile) connection alive and for fast recognition of

connection losses.

The WebSocketWriter class (obviously) already implements sending Pings

and Pongs, and it would be trivial to expose that to the application.

I am not sure if thats good design though, since the idea is to mimick

the WebSocket API thats available in browsers - and you cannot send

Pings from JavaScript in browsers.

Whats your use case?

Cheers,

Tobias

0 Likes