Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to add a message handler to a websocket session?

Thanks a lot Joachim, will try!

On Wed, Jun 26, 2013 at 6:39 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
> The Jetty WebSocket API in Jetty 9.0.x is not an implementation of the
> JSR-356 standard (aka the javax.websocket namespace).
>
> We have been involved in that standard and spec and have an implementation
> of our own in the jetty-9.1 branch (its mostly complete at the moment).
>
> Now, how to see a PING or PONG data frame with the Jetty API...
>
>     @OnWebSocketFrame
>     public void onFrame(Frame frame)
>     {
>         if(frame.getType() == Type.PONG) {
>             // do your processing of PONG
>         }
>     }
>
> Hope this helps
>
>
> --
> Joakim Erdfelt <joakim@xxxxxxxxxxx>
> webtide.com
> Developer advice, services and support
> from the Jetty & CometD experts
> eclipse.org/jetty - cometd.org
>
>
> On Wed, Jun 26, 2013 at 7:57 AM, Verachten Bruno <gounthar@xxxxxxxxx> wrote:
>>
>> Hello all,
>>
>> I am trying to get the ping/pong working, but I just don't know if the
>> client sends the pong back.
>> I tried to cast a Jetty websocket session into a
>> java.websocket.session, but that's wrong.
>> How can I add a message handler (to handle the pong response) to a
>> Jetty websocket session?
>>
>> Thanks in advance,
>> --
>> Bruno Verachten
>> _______________________________________________
>> jetty-users mailing list
>> jetty-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



-- 
Bruno Verachten


Back to the top