こんにちは私は文字列を受け入れる必要があるハンドラーを備えたNettyサーバーを持っています。1024バイトまでのコンテンツしか受信できないようです。バッファサイズを増やすにはどうすればよいですか。私はすでに試しました
bootstrap.setOption("child.sendBufferSize", 1048576);
bootstrap.setOption("child.receiveBufferSize", 1048576);
成功せずに。
ハンドラーは以下の通りです
public class TestHandler extends SimpleChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
ChannelBuffer buf = (ChannelBuffer) e.getMessage();
String response = "";
if (buf.readable()) {
response = buf.toString(CharsetUtil.UTF_8);
System.out.println("CONTENT: " + response);
}
System.out.println(response);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
e.getCause().printStackTrace();
Channel ch = e.getChannel();
ch.close();
}
}