-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channel().localAddress() not always return an InetSocketAddress #330
base: main
Are you sure you want to change the base?
Conversation
Travis failed only for jruby 1.7.27. All others succeeded. Is that something related to this PR or more generic . |
4ac6c49
to
13374df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on code duplication and a spacing nitpick. Other than that, this looks great - thanks for the contribution!
SocketAddress local = context.channel().localAddress(); | ||
SocketAddress remote = context.channel().remoteAddress(); | ||
|
||
String localhost ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: unnecessary space before ;
if (local instanceof InetSocketAddress) { | ||
InetSocketAddress inetlocal = (InetSocketAddress)local; | ||
localhost = inetlocal.getAddress().getHostAddress() + ":" + inetlocal.getPort(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you refactor this to remove the code duplication?
13374df
to
8600bf9
Compare
$ rvm use jruby-9.1.13.0 --install --binary --fuzzy The travis failure is not mine. |
8600bf9
to
71464c6
Compare
71464c6
to
0306426
Compare
…example during unit tests. So check they are the right type before type cast.
0306426
to
29fc4ea
Compare
channel().localAddress() not always return an InetSocketAddress, for example during unit tests.
So check they are the right type before type cast.
It must be merged before PR #329.