Get remote IP address at connection timeout
royce123
pmhalm at mytum.de
Mon Jul 19 13:09:31 EDT 2010
Hello everybody,
i am really new to netty, but for now i already like its performance.
But there is something that bothers me:
If there happens a connection timeout and i am catching the exception i'd
like to have the remote host's ip address to process the further error
handling.
i am implementing the SimpleChannelHandler Interface and overwrite this
method:
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
InetSocketAddress remote =
InetSocketAddress)e.getChannel().getRemoteAddress();
String clientIP = remote.getAddress().getHostAddress();
e.getChannel().close();
}
As you can see, i am trying to get the ip adress, but it always results as
NULL probably because netty does not know the address anymore.
Can you tell me any solution how i cat the ip address of the client who
caused the timeout
exception.
Any hints would really be appreciated.
thank you,
best regards
royce123
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Get-remote-IP-address-at-connection-timeout-tp5312983p5312983.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list