I use MyDecoder
which extends ByteToMessageDecoder
to get Message from the socket Stream.
It works fine in one thread. But in more threads, the netty has reported 'the handler should be sharable'
However, I search in netty api, the ByteToMessageDecoder
can't be @sharable, so how can I use
it in multi thread.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Create a new instance in your ChannelInitializer.