From 50e9b793603bf84c74174c1c3b048746e6c26d90 Mon Sep 17 00:00:00 2001 From: Rapsssito Date: Thu, 18 Jun 2020 20:31:28 +0200 Subject: [PATCH] fix(Android): Fix server socket events not being delivered Fixes #54 --- .../java/com/asterinet/react/tcpsocket/TcpSocketServer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java b/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java index 43d970a..9514ebe 100644 --- a/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java +++ b/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java @@ -11,7 +11,6 @@ import java.net.ServerSocket; import java.net.Socket; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; public final class TcpSocketServer extends TcpSocketClient { private ServerSocket serverSocket; @@ -29,8 +28,8 @@ protected Void doInBackground(Object[] objects) { int clientId = getClientId(); TcpSocketClient socketClient = new TcpSocketClient(mReceiverListener, clientId, socket); socketClients.put(clientId, socketClient); - socketClient.startListening(); mReceiverListener.onConnection(getId(), clientId, new InetSocketAddress(socket.getInetAddress(), socket.getPort())); + socketClient.startListening(); } } catch (IOException e) { if (!serverSocket.isClosed()) {