在netty中使用TextWebsocketFrame在不同的textarea中编写不同的消息

Writing different message in different TextAreas with TextWebsocketFrame in netty

本文关键字:消息 textarea netty TextWebsocketFrame      更新时间:2023-09-26

用于写入我正在使用的套接字。频道。writeAndFlush(new TextWebSocketFrame(String msg));
并在我的网页(即显示给客户端)我从事件(event.data)获得数据,并显示在文本区域(说T1)。但我有2个文本区域(说T1和T2),在这两个我想显示不同的数据。我想不出一个办法来做这件事。所以如果我能得到一些实现或者一些方法来得到想要的功能。谢谢。

您需要在WebSocketFrame中编码一些"标记",该标记可用于检测文本进入哪一帧。比如Json之类的