0
我想在Netty中混合TCP和WebSockets。 我有两台服务器,一台使用Websockets,一台使用TCP。 DefaultUserGroup中收集的所有用户以及此原因导致我不知道userGroup中的哪个用户来自WebSockets或TCP,我无法正确写入它们(DefaultUserGroup.write)。Netty WebSockets和TCP套接字
WebSocket伺服器:
ChannelPipeline pipeline = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("handler", new WebSocketServerHandler(readQueueHandler));
TCP服务器:
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
pipeline.addLast("handler", new MyBusinessLogicHandler(readQueueHandler));
你的问题到底是什么? – 2012-02-06 13:32:37