Hello,
I am trying to do Server initiated Websocket ping / pong. - i
have forced my way into sending the ping, but unfortunately the pong
returned by the client is ignored.
i can send the ping with code like this :
WebSocketFrameImpl frame =
new WebSocketFrameImpl(FrameType.
PING,io.netty.buffer.Unpooled.
copyLong(System.
currentTimeMillis()));
ws.writeFrame(frame);
Unfortunately the
HttpServerImpl.java swallows the PONG answer.
case PING:
// Echo back the content of the PING frame as PONG frame as specified in RFC 6455 Section 5.5.2
ch.writeAndFlush(new WebSocketFrameImpl(FrameType.
PONG, wsFrame.getBinaryData()));
break;
case PONG:
// Just ignore it
break;
So I believe it would be useful if PONG case is also passed to upper layer. (and ease the ping sending also) what do you think ?
My rational being this is that i am dealing with long websocket connection (so idle not an option) toward mobile device that may loose connection without properly closing them..
when server writes to such (unattended) websocket there is no error.( if i could get such error it would even be better for me).
and I would like to avoid to have to implement it on top of the the text/binary frame when already available and implemented in client websocket impl) .
thx
lce.
ps : sorry if some of you see this as a resend- first version fired too quickly.