All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.undertow.examples.jsrwebsockets.JsrChatWebSocketEndpoint Maven / Gradle / Ivy

There is a newer version: 2.2.13.Final
Show newest version
package io.undertow.examples.jsrwebsockets;

import javax.websocket.OnMessage;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

/**
 * @author Stuart Douglas
 */
@ServerEndpoint("/myapp")
public class JsrChatWebSocketEndpoint {

    @OnMessage
    public void message(String message, Session session) {
        for (Session s : session.getOpenSessions()) {
            s.getAsyncRemote().sendText(message);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy