getRemoteAddress doesn't work on Android (at least not KitKat), so let's get the address this way.

This commit is contained in:
Christian Basler 2016-09-26 17:38:50 +02:00
parent 1003e7a582
commit 579d604ac6
1 changed files with 5 additions and 1 deletions

View File

@ -231,7 +231,11 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
SocketChannel accepted = ((ServerSocketChannel) key.channel()).accept();
accepted.configureBlocking(false);
ConnectionInfo connection = new ConnectionInfo(ctx, SERVER,
new NetworkAddress.Builder().address(accepted.getRemoteAddress()).stream(1).build(),
new NetworkAddress.Builder()
.ip(accepted.socket().getInetAddress())
.port(accepted.socket().getPort())
.stream(1)
.build(),
requestedObjects, 0
);
connections.put(