Get remote IP address at connection timeout
Marc-André Laverdière
marcandre.laverdiere at gmail.com
Wed Jul 21 06:33:17 EDT 2010
You could maybe store it preventively in a ChannelLocal ?
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
2010/7/19 royce123 <pmhalm at mytum.de>:
>
> 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.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
More information about the netty-users
mailing list