[undertow-dev] Websockets API

Eitan Yarden eitan at paralleluniverse.co
Tue Oct 15 07:47:53 EDT 2013


Hi,

I'm trying to run the websockets example with undertow-core-1.0.0.Beta18
but it doesn't seem to work.
I simplified the code:

public class WebSocketServer {
    public static void main(final String[] args) {
        Undertow.builder().addListener(8080,
"localhost").setHandler(path().addPath("/myapp", websocket(new
WebSocketConnectionCallback() {
            @Override
            public void onConnect(WebSocketHttpExchange exchange,
WebSocketChannel channel) {
                System.out.println("**** onConnect ********");
                channel.getReceiveSetter().set(new
AbstractReceiveListener() {
                    @Override
                    protected void onFullTextMessage(WebSocketChannel
channel, BufferedTextMessage message) {
                        System.out.println("**** onFullTextMessage
********");
                        WebSockets.sendText(message.getData(), channel,
null);
                    }
                });
            }
        }))).build().start();
    }
}

Although the "OnConnect" handler is called, the "onFullTextMessage" is
never called.
Do someone know why ?

Thanks
Eitan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20131015/1eef8375/attachment.html 


More information about the undertow-dev mailing list