Package com.ibdknox.socket_io_netty

Source Code of com.ibdknox.socket_io_netty.WebSocketIOClient

package com.ibdknox.socket_io_netty;

import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.http.websocket.DefaultWebSocketFrame;


public class WebSocketIOClient extends GenericIOClient {

    public WebSocketIOClient(ChannelHandlerContext ctx, String uID) {
        super(ctx, uID);
    }

    @Override
    public void sendUnencoded(String message) {
        if(!this.open) return;

        Channel chan = ctx.getChannel();
        if(chan.isOpen()) {
            chan.write(new DefaultWebSocketFrame(message));
        } else {
            this.disconnect();
        }
    }
}
TOP

Related Classes of com.ibdknox.socket_io_netty.WebSocketIOClient

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.