Examples of IWebSocketHandler


Examples of org.xlightweb.IWebSocketHandler

*/
public final class SimpleWebSocketServerExample   {
 
    public static void main(String[] args) throws IOException {

        IWebSocketHandler echoHandler = new IWebSocketHandler() {
           
            public void onConnect(IWebSocketConnection con) throws IOException, UnsupportedProtocolException {
                if ((con.getProtocol() == null) || !con.getProtocol().equalsIgnoreCase("com.example.echo")) {
                    throw new UnsupportedProtocolException("protocol " + con.getProtocol() + " is not supported (supported: com.example.echo)");
                }
View Full Code Here

Examples of org.xlightweb.IWebSocketHandler

        HttpClient httpClient = new HttpClient();
   
    
        /////////////////////////
        // with handler
        IWebSocketHandler handler = new IWebSocketHandler() {
           
            public void onMessage(IWebSocketConnection con) throws IOException {
                TextMessage msg = con.readTextMessage();
                System.out.println(msg);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.