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()) {