import com.corundumstudio.socketio.SocketConfig; import com.corundumstudio.socketio.SocketIOClient; import com.corundumstudio.socketio.SocketIOServer; import com.corundumstudio.socketio.Transport; import com.corundumstudio.socketio.listener.ConnectListener; import com.corundumstudio.socketio.listener.DataListener...
代码示例来源:origin: mrniko/netty-socketio private void handleHTTP(OutPacketMessage msg, ChannelHandlerContext ctx, ChannelPromise promise) throws IOException { Channel channel = ctx.channel(); Attribute<Boolean> attr = channel.attr(WRITE_ONCE); Queue<Packet> queue = msg.getClientHead().getPackets...
//1) 如果当前注册返回的selectionKey已经被取消,则抛出CancelledKeyException异常,捕获该异常进行处理。 //2) 如果是第一次处理该异常,调用多路复用器的selectNow()方法将已经取消的selectionKey从多路复用器中删除掉。操作成功之后,将selected置为true, 说明之前失效的selectionKey已经被删除掉。继续发起下一次注册操作,...
代码示例来源:origin: mrniko/netty-socketio private void sendError(ChannelHandlerContext ctx) { HttpResponse res = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR); ctx.channel().writeAndFlush(res).addListener(ChannelFutureListener.CLOSE); } 代码示例来源:origin: fengjiachu...
代码示例来源:origin: mrniko/netty-socketio privatevoidhandshake(ChannelHandlerContextctx,finalUUID sessionId,Stringpath,FullHttpRequestreq){ finalChannelchannel=ctx.channel(); WebSocketServerHandshakerFactoryfactory= newWebSocketServerHandshakerFactory(getWebSocketLocation(req),null,true,configuration.getMaxFrame...
log.warn("Blocked wrong socket.io-context request! url: {}, params: {}, ip: {}",queryDecoder.path(),queryDecoder.parameters(),channel.remoteAddress()); return; } super.channelRead(ctx,msg); } 代码示例来源:origin: mrniko/netty-socketio ...
包路径:io.netty.util.Timeout 类名称:Timeout 方法名:isCancelled Timeout.isCancelled介绍 [英]Returns true if and only if the TimerTask associated with this handle has been cancelled. [中]当且仅当与此句柄关联的TimerTask已取消时,返回true。
代码示例来源:origin: mrniko/netty-socketio private void write(XHRPostMessage msg, ChannelHandlerContext ctx, ChannelPromise promise) { ByteBuf out = encoder.allocateBuffer(ctx.alloc()); out.writeBytes(OK); sendMessage(msg, ctx.channel(), out, "text/html", promise, HttpResponseStatus.OK); ...
代码示例来源:origin: mrniko/netty-socketio log.debug("Client with was already disconnected. Channel closed!"); ctx.channel().close(); frame.release(); return; frame.release(); } else if (msg instanceof FullHttpRequest) { FullHttpRequest req = (FullHttpRequest) msg; 代码示例来源:origin:...
WEB_SOCKET_TRANSPORT, SocketIOChannelInitializer.WEB_SOCKET_AGGREGATOR, new WebSocketFrameAggregator(configuration.getMaxFramePayloadLength())); connectClient(channel, sessionId); } }); } else { WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel()); } } 代码示例来源:origin: james...