Fixed a problem where XnioChannelRegistry fails to find a server channel if IPv6 local address is specified
This commit is contained in:
parent
9043fdb622
commit
c3bd292f73
@ -22,7 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.jboss.netty.channel.xnio;
|
package org.jboss.netty.channel.xnio;
|
||||||
|
|
||||||
import java.net.Inet4Address;
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
@ -89,9 +88,8 @@ final class XnioChannelRegistry {
|
|||||||
XnioServerChannel answer = serverChannels.get(localAddress);
|
XnioServerChannel answer = serverChannels.get(localAddress);
|
||||||
if (answer == null && localAddress instanceof InetSocketAddress) {
|
if (answer == null && localAddress instanceof InetSocketAddress) {
|
||||||
InetSocketAddress a = (InetSocketAddress) localAddress;
|
InetSocketAddress a = (InetSocketAddress) localAddress;
|
||||||
if (a.getAddress() instanceof Inet4Address) {
|
answer = serverChannels.get(new InetSocketAddress(ANY_IPV6, a.getPort()));
|
||||||
answer = serverChannels.get(new InetSocketAddress(ANY_IPV6, a.getPort()));
|
if (answer == null) {
|
||||||
} else {
|
|
||||||
answer = serverChannels.get(new InetSocketAddress(ANY_IPV4, a.getPort()));
|
answer = serverChannels.get(new InetSocketAddress(ANY_IPV4, a.getPort()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user