Home > Back-end >  Netty send websocket data failed
Netty send websocket data failed

Time:09-27

Inside the handler class
 
/* *
* data triggered when
*/
@ Override
Protected void channelRead0 (ChannelHandlerContext CTX, TextWebSocketFrame MSG) throws the Exception {

}

/* *
* connection is established after the first executive
*/
@ Override
Public void handlerAdded ChannelHandlerContext (CTX) throws the Exception {
CTX. Channel (.) writeAndFlush (new TextWebSocketFrame (" hello world "));
}



Front-end receive less than data, send in function channelRead0 can receive this is going on

CodePudding user response:

Your channelRead0 the code

CodePudding user response:

reference 1st floor tianfang response:
code of your channelRead0?


Does not affect the back of the sent you two function test are the
CTX. Channel (.) writeAndFlush (new TextWebSocketFrame (" hello world "));

CodePudding user response:

Should be received, the first connection can be sent
  • Related