| | |
| | | import io.netty.util.AttributeKey; |
| | | import io.netty.util.CharsetUtil; |
| | | import org.springblade.modules.nettyServer.NettyConfig; |
| | | import org.springblade.modules.suser.service.ISuserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | private WebSocketServerHandshaker handshaker; |
| | | |
| | | private String on=null; |
| | | |
| | | @Autowired |
| | | private ISuserService suserService; |
| | | |
| | | private static WebSocketHandler webSocketHandler; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // TextWebSocketFrame tws = new TextWebSocketFrame(new Date().toString() |
| | |
| | | // f.addListener(ChannelFutureListener.CLOSE); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | cause.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 删除用户与channel 对应关系 |
| | | * |
| | | * @param ctx |
| | | */ |
| | | private void removeUserId(ChannelHandlerContext ctx){ |