Developer
[netty] timeout 설정
rocksea
2013. 2. 15. 14:56
드디어 개발 완료시점이 되어 예외처리에 신경쓰게 되었습니다.
일단 time out 설정에대해 알아보도록 하겠습니다.
// Set up the pipeline factory.
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
public ChannelPipeline getPipeline() throws Exception {
//Netty Connection Timeout And Handler Setting
return Channels.pipeline(new ReadTimeoutHandler(new HashedWheelTimer(),30),new NettyServerHandler());
}
});
무지간단해서 부가설명이 필요없을듯 합니다.
그리고 console에서 time out 처리를 확인만 해보시면 됩니다.
DEBUG: server.NettyServer - start main...
INFO : server.NettyServerHandler - Unexpected exception from downstream.org.jboss.netty.handler.timeout.ReadTimeoutException
설정한 시간이 지난 뒤 (초단위) 위와같은 exception이 발생하면 성공입니다.
이상입니다.
.by rocksea