getRemoteAddress doesn't work on Android (at least not KitKat), so let's get the address this way.
This commit is contained in:
parent
1003e7a582
commit
579d604ac6
@ -231,7 +231,11 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
|
|||||||
SocketChannel accepted = ((ServerSocketChannel) key.channel()).accept();
|
SocketChannel accepted = ((ServerSocketChannel) key.channel()).accept();
|
||||||
accepted.configureBlocking(false);
|
accepted.configureBlocking(false);
|
||||||
ConnectionInfo connection = new ConnectionInfo(ctx, SERVER,
|
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
|
requestedObjects, 0
|
||||||
);
|
);
|
||||||
connections.put(
|
connections.put(
|
||||||
|
Loading…
Reference in New Issue
Block a user