diff --git a/.eslintrc.json b/.eslintrc.json
index 4843018..2ed7451 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,6 +1,6 @@
{
"parser": "babel-eslint",
- "plugins": ["prettier", "jest", "jsdoc"],
+ "plugins": ["prettier", "jest"],
"env": {
"es6": true,
"node": true
@@ -13,8 +13,7 @@
"eslint:recommended",
"prettier",
"plugin:jest/recommended",
- "plugin:jest/style",
- "plugin:jsdoc/recommended"
+ "plugin:jest/style"
],
"rules": {
"prefer-const": [
@@ -28,10 +27,6 @@
"no-var": "error",
"prefer-template": 2,
"require-atomic-updates": "off",
- "prettier/prettier": ["error"],
- "jsdoc/require-returns-description": 0,
- "jsdoc/require-param-description": 0,
- "jsdoc/no-undefined-types": 0,
- "jsdoc/require-returns": 0
+ "prettier/prettier": ["error"]
}
}
diff --git a/README.md b/README.md
index f76fab9..22fa5ec 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# react-native-tcp-socket
+# react-native-tcp-socket
@@ -7,15 +7,22 @@
React Native TCP socket API for Android & iOS with **client SSL/TLS support**. It allows you to create TCP clients and servers sockets, imitating some of Node's [net](https://nodejs.org/api/net.html) API functionalities (check the available [API](#api) for more information).
-## Table of Contents
+## Table of Contents
- [Getting started](#getting-started)
- - [Self-Signed SSL](#self-signed-ssl-only-available-for-react-native--060)
-- [Compatibility](#react-native-compatibility)
+ - [Using React Native >= 0.60](#using-react-native--060)
+ - [Self-Signed SSL (only available for React Native > 0.60)](#self-signed-ssl-only-available-for-react-native--060)
+ - [Using React Native < 0.60](#using-react-native--060-1)
+- [React Native Compatibility](#react-native-compatibility)
- [Usage](#usage)
+ - [Client](#client)
+ - [Server](#server)
+ - [SSL Client](#ssl-client)
- [API](#api)
- [TcpSocket](#tcpsocket)
+ - [`createConnection()`](#createconnection)
- [TcpServer](#tcpserver)
+ - [`listen()`](#listen)
- [Maintainers](#maintainers)
- [Acknowledgments](#acknowledgments)
- [License](#license)
@@ -195,6 +202,12 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
* [`setNoDelay([noDelay])`](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay)
* [`setTimeout(timeout[, callback])`](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback)
* [`write(data[, encoding][, callback])`](https://nodejs.org/api/net.html#net_socket_write_data_encoding_callback)
+* **Properties:**
+ * [`'remoteAddress'`](https://nodejs.org/api/net.html#net_socket_remoteaddress)
+ * [`'remoteFamily'`](https://nodejs.org/api/net.html#net_socket_remotefamily)
+ * [`'remotePort'`](https://nodejs.org/api/net.html#net_socket_remoteport)
+ * [`'localAddress'`](https://nodejs.org/api/net.html#net_socket_localaddress)
+ * [`'localPort'`](https://nodejs.org/api/net.html#net_socket_localport)
* **Events:**
* [`'close'`](https://nodejs.org/api/net.html#net_event_close_1)
* [`'connect'`](https://nodejs.org/api/net.html#net_event_connect)
@@ -203,7 +216,7 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
#### `createConnection()`
`createConnection(options[, callback])` creates a TCP connection using the given [`options`](#createconnection-options).
-##### `createConnection: options`
+##### `createConnection: options`
**Required**. Available options for creating a socket. It must be an `object` with the following properties:
| Property | Type | iOS | Android |Description |
@@ -226,11 +239,16 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
* [`TcpSocket.createServer(connectionListener)`](https://nodejs.org/api/net.html#net_net_createserver_options_connectionlistener)
* **[`listen(options[, callback])`](#listen)**
* [`close([callback])`](https://nodejs.org/api/net.html#net_server_close_callback)
+* **Events:**
+ * [`'close'`](https://nodejs.org/api/net.html#net_event_close)
+ * [`'connection'`](https://nodejs.org/api/net.html#net_event_connection)
+ * [`'error'`](https://nodejs.org/api/net.html#net_event_error)
+ * [`'listening'`](https://nodejs.org/api/net.html#net_event_listening)
#### `listen()`
`listen(options[, callback])` creates a TCP server socket using the given [`options`](#listen-options).
-##### `listen: options`
+##### `listen: options`
**Required**. Available options for creating a server socket. It must be an `object` with the following properties:
| Property | Type | iOS | Android |Description |
diff --git a/android/src/main/java/com/asterinet/react/tcpsocket/TcpReceiverTask.java b/android/src/main/java/com/asterinet/react/tcpsocket/TcpReceiverTask.java
index fdee11f..764c879 100644
--- a/android/src/main/java/com/asterinet/react/tcpsocket/TcpReceiverTask.java
+++ b/android/src/main/java/com/asterinet/react/tcpsocket/TcpReceiverTask.java
@@ -38,7 +38,7 @@ protected final Void doInBackground(Pair 0) {
receiverListener.onData(socketId, Arrays.copyOfRange(buffer, 0, bufferCount));
} else if (bufferCount == -1) {
- clientSocket.close();
+ clientSocket.destroy();
}
}
} catch (IOException ioe) {
@@ -55,9 +55,11 @@ protected final Void doInBackground(Pair socketClients = new ConcurrentHashMap<>();
+ private final ConcurrentHashMap socketMap = new ConcurrentHashMap<>();
private final ConcurrentHashMap mNetworkMap = new ConcurrentHashMap<>();
private final CurrentNetwork currentNetwork = new CurrentNetwork();
private final ExecutorService executorService = Executors.newFixedThreadPool(N_THREADS);
@@ -73,8 +75,7 @@ public void connect(@NonNull final Integer cId, @NonNull final String host, @Non
executorService.execute(new Thread(new Runnable() {
@Override
public void run() {
- TcpSocketClient client = socketClients.get(cId);
- if (client != null) {
+ if (socketMap.get(cId) != null) {
onError(cId, TAG + "createSocket called twice with the same id.");
return;
}
@@ -83,10 +84,10 @@ public void run() {
final String localAddress = options.hasKey("localAddress") ? options.getString("localAddress") : null;
final String iface = options.hasKey("interface") ? options.getString("interface") : null;
selectNetwork(iface, localAddress);
- client = new TcpSocketClient(TcpSocketModule.this, cId, null);
- socketClients.put(cId, client);
+ TcpSocketClient client = new TcpSocketClient(TcpSocketModule.this, cId, null);
+ socketMap.put(cId, client);
client.connect(mReactContext, host, port, options, currentNetwork.getNetwork());
- onConnect(cId, host, port);
+ onConnect(cId, client);
} catch (Exception e) {
onError(cId, e.getMessage());
}
@@ -101,10 +102,7 @@ public void write(@NonNull final Integer cId, @NonNull final String base64String
executorService.execute(new Thread(new Runnable() {
@Override
public void run() {
- TcpSocketClient socketClient = socketClients.get(cId);
- if (socketClient == null) {
- return;
- }
+ TcpSocketClient socketClient = getTcpClient(cId);
try {
socketClient.write(Base64.decode(base64String, Base64.NO_WRAP));
if (callback != null) {
@@ -127,12 +125,9 @@ public void end(final Integer cId) {
executorService.execute(new Thread(new Runnable() {
@Override
public void run() {
- TcpSocketClient socketClient = socketClients.get(cId);
- if (socketClient == null) {
- return;
- }
- socketClient.close();
- socketClients.remove(cId);
+ TcpSocketClient socketClient = getTcpClient(cId);
+ socketClient.destroy();
+ socketMap.remove(cId);
}
}));
}
@@ -143,6 +138,19 @@ public void destroy(final Integer cId) {
end(cId);
}
+ @SuppressWarnings("unused")
+ @ReactMethod
+ public void close(final Integer cId) {
+ executorService.execute(new Thread(new Runnable() {
+ @Override
+ public void run() {
+ TcpSocketServer socketServer = getTcpServer(cId);
+ socketServer.close();
+ socketMap.remove(cId);
+ }
+ }));
+ }
+
@SuppressLint("StaticFieldLeak")
@SuppressWarnings("unused")
@ReactMethod
@@ -151,11 +159,11 @@ public void listen(final Integer cId, final ReadableMap options) {
@Override
public void run() {
try {
- TcpSocketServer server = new TcpSocketServer(socketClients, TcpSocketModule.this, cId, options);
- socketClients.put(cId, server);
+ TcpSocketServer server = new TcpSocketServer(socketMap, TcpSocketModule.this, cId, options);
+ socketMap.put(cId, server);
int port = server.getListeningPort();
String host = options.getString("host");
- onConnect(cId, host, port);
+ onListen(cId, server);
} catch (Exception uhe) {
onError(cId, uhe.getMessage());
}
@@ -166,11 +174,7 @@ public void run() {
@SuppressWarnings("unused")
@ReactMethod
public void setNoDelay(@NonNull final Integer cId, final boolean noDelay) {
- final TcpSocketClient client = socketClients.get(cId);
- if (client == null) {
- onError(cId, TAG + "socket not found.");
- return;
- }
+ final TcpSocketClient client = getTcpClient(cId);
try {
client.setNoDelay(noDelay);
} catch (IOException e) {
@@ -181,11 +185,7 @@ public void setNoDelay(@NonNull final Integer cId, final boolean noDelay) {
@SuppressWarnings("unused")
@ReactMethod
public void setKeepAlive(@NonNull final Integer cId, final boolean enable, final int initialDelay) {
- final TcpSocketClient client = socketClients.get(cId);
- if (client == null) {
- onError(cId, TAG + "socket not found.");
- return;
- }
+ final TcpSocketClient client = getTcpClient(cId);
try {
client.setKeepAlive(enable, initialDelay);
} catch (IOException e) {
@@ -258,17 +258,37 @@ private void selectNetwork(@Nullable final String iface, @Nullable final String
// TcpReceiverTask.OnDataReceivedListener
@Override
- public void onConnect(Integer id, String host, int port) {
+ public void onConnect(Integer id, TcpSocketClient client) {
WritableMap eventParams = Arguments.createMap();
eventParams.putInt("id", id);
- WritableMap addressParams = Arguments.createMap();
- addressParams.putString("address", host);
- addressParams.putInt("port", port);
- eventParams.putMap("address", addressParams);
-
+ WritableMap connectionParams = Arguments.createMap();
+ final Socket socket = client.getSocket();
+ final InetSocketAddress remoteAddress = (InetSocketAddress) socket.getRemoteSocketAddress();
+
+ connectionParams.putString("localAddress", socket.getLocalAddress().getHostAddress());
+ connectionParams.putInt("localPort", socket.getLocalPort());
+ connectionParams.putString("remoteAddress", remoteAddress.getHostName());
+ connectionParams.putInt("remotePort", socket.getPort());
+ connectionParams.putString("remoteFamily", remoteAddress.getAddress() instanceof Inet6Address ? "IPv6" : "IPv4");
+ eventParams.putMap("connection", connectionParams);
sendEvent("connect", eventParams);
}
+ @Override
+ public void onListen(Integer id, TcpSocketServer server) {
+ WritableMap eventParams = Arguments.createMap();
+ eventParams.putInt("id", id);
+ WritableMap connectionParams = Arguments.createMap();
+ final ServerSocket serverSocket = server.getServerSocket();
+ final InetAddress address = serverSocket.getInetAddress();
+
+ connectionParams.putString("localAddress", serverSocket.getInetAddress().getHostAddress());
+ connectionParams.putInt("localPort", serverSocket.getLocalPort());
+ connectionParams.putString("localFamily", address instanceof Inet6Address ? "IPv6" : "IPv4");
+ eventParams.putMap("connection", connectionParams);
+ sendEvent("listening", eventParams);
+ }
+
@Override
public void onData(Integer id, byte[] data) {
WritableMap eventParams = Arguments.createMap();
@@ -300,26 +320,50 @@ public void onError(Integer id, String error) {
}
@Override
- public void onConnection(Integer serverId, Integer clientId, InetSocketAddress socketAddress) {
+ public void onConnection(Integer serverId, Integer clientId, Socket socket) {
WritableMap eventParams = Arguments.createMap();
eventParams.putInt("id", serverId);
WritableMap infoParams = Arguments.createMap();
infoParams.putInt("id", clientId);
- final InetAddress address = socketAddress.getAddress();
+ WritableMap connectionParams = Arguments.createMap();
+ final InetSocketAddress remoteAddress = (InetSocketAddress) socket.getRemoteSocketAddress();
- WritableMap addressParams = Arguments.createMap();
- addressParams.putString("address", address.getHostAddress());
- addressParams.putInt("port", socketAddress.getPort());
- addressParams.putString("family", address instanceof Inet6Address ? "IPv6" : "IPv4");
+ connectionParams.putString("localAddress", socket.getLocalAddress().getHostAddress());
+ connectionParams.putInt("localPort", socket.getLocalPort());
+ connectionParams.putString("remoteAddress", remoteAddress.getHostName());
+ connectionParams.putInt("remotePort", socket.getPort());
+ connectionParams.putString("remoteFamily", remoteAddress.getAddress() instanceof Inet6Address ? "IPv6" : "IPv4");
- infoParams.putMap("address", addressParams);
+ infoParams.putMap("connection", connectionParams);
eventParams.putMap("info", infoParams);
sendEvent("connection", eventParams);
}
+ private TcpSocketClient getTcpClient(final int id) {
+ TcpSocket socket = socketMap.get(id);
+ if (socket == null) {
+ throw new IllegalArgumentException(TAG + "No socket with id " + id);
+ }
+ if (!(socket instanceof TcpSocketClient)) {
+ throw new IllegalArgumentException(TAG + "Socket with id " + id + " is not a client");
+ }
+ return (TcpSocketClient) socket;
+ }
+
+ private TcpSocketServer getTcpServer(final int id) {
+ TcpSocket socket = socketMap.get(id);
+ if (socket == null) {
+ throw new IllegalArgumentException(TAG + "No socket with id " + id);
+ }
+ if (!(socket instanceof TcpSocketServer)) {
+ throw new IllegalArgumentException(TAG + "Socket with id " + id + " is not a server");
+ }
+ return (TcpSocketServer) socket;
+ }
+
private static class CurrentNetwork {
@Nullable
Network network = null;
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 09b556d..5e955a7 100644
--- a/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java
+++ b/android/src/main/java/com/asterinet/react/tcpsocket/TcpSocketServer.java
@@ -11,12 +11,15 @@
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
-public final class TcpSocketServer extends TcpSocketClient {
+public final class TcpSocketServer extends TcpSocket {
private ServerSocket serverSocket;
private TcpReceiverTask.OnDataReceivedListener mReceiverListener;
private int clientSocketIds;
- private final ConcurrentHashMap socketClients;
+ private final ExecutorService executorService;
+ private final ConcurrentHashMap socketClients;
@SuppressLint("StaticFieldLeak")
private final AsyncTask listening = new AsyncTask() {
@@ -28,7 +31,7 @@ protected Void doInBackground(Object[] objects) {
int clientId = getClientId();
TcpSocketClient socketClient = new TcpSocketClient(mReceiverListener, clientId, socket);
socketClients.put(clientId, socketClient);
- mReceiverListener.onConnection(getId(), clientId, new InetSocketAddress(socket.getInetAddress(), socket.getPort()));
+ mReceiverListener.onConnection(getId(), clientId, socket);
socketClient.startListening();
}
} catch (IOException e) {
@@ -41,9 +44,10 @@ protected Void doInBackground(Object[] objects) {
};
- public TcpSocketServer(final ConcurrentHashMap socketClients, final TcpReceiverTask.OnDataReceivedListener receiverListener, final Integer id,
+ public TcpSocketServer(final ConcurrentHashMap socketClients, final TcpReceiverTask.OnDataReceivedListener receiverListener, final Integer id,
final ReadableMap options) throws IOException {
super(id);
+ this.executorService = Executors.newFixedThreadPool(1);
// Get data from options
int port = options.getInt("port");
String address = options.getString("host");
@@ -66,6 +70,10 @@ public TcpSocketServer(final ConcurrentHashMap socketC
listen();
}
+ public ServerSocket getServerSocket() {
+ return serverSocket;
+ }
+
/**
* Next ID for a client socket
*
@@ -77,21 +85,15 @@ private int getClientId() {
private void listen() {
//noinspection unchecked
- listening.executeOnExecutor(getExecutorService());
- }
-
- @Override
- public void write(final byte[] data) {
- mReceiverListener.onError(getId(), "SERVER CANNOT WRITE");
+ listening.executeOnExecutor(executorService);
}
- @Override
public void close() {
try {
if (!listening.isCancelled()) {
// stop the receiving task
listening.cancel(true);
- getExecutorService().shutdown();
+ executorService.shutdown();
}
// close the socket
diff --git a/examples/tcpsockets/App.js b/examples/tcpsockets/App.js
index 3f04601..c3777f4 100644
--- a/examples/tcpsockets/App.js
+++ b/examples/tcpsockets/App.js
@@ -34,7 +34,15 @@ class App extends React.Component {
let server;
let client;
server = TcpSocket.createServer((socket) => {
- this.updateChatter('server connected on ' + JSON.stringify(socket.address()));
+ this.updateChatter('client connected to server on ' + JSON.stringify(socket.address()));
+ console.log(
+ 'Server client',
+ socket.localAddress,
+ socket.localPort,
+ socket.remoteAddress,
+ socket.remotePort,
+ socket.remoteFamily
+ );
socket.on('data', (data) => {
this.updateChatter('Server Received: ' + data);
@@ -48,8 +56,8 @@ class App extends React.Component {
socket.on('close', (error) => {
this.updateChatter('server client closed ' + (error ? error : ''));
});
- }).listen({port: serverPort, host: serverHost, reuseAddress: true}, (address) => {
- this.updateChatter('opened server on ' + JSON.stringify(address));
+ }).listen({port: serverPort, host: serverHost, reuseAddress: true}, () => {
+ this.updateChatter('opened server on ' + JSON.stringify(server.address()));
});
server.on('error', (error) => {
@@ -68,12 +76,20 @@ class App extends React.Component {
// localPort: 20000,
// interface: "wifi",
// tls: true
- }, (address) => {
- this.updateChatter('opened client on ' + JSON.stringify(address));
+ }, () => {
+ this.updateChatter('opened client on ' + JSON.stringify(client.address()));
client.write('Hello, server! Love, Client.');
});
client.on('data', (data) => {
+ console.log(
+ 'Initial client',
+ client.localAddress,
+ client.localPort,
+ client.remoteAddress,
+ client.remotePort,
+ client.remoteFamily
+ );
this.updateChatter('Client Received: ' + data);
this.client.destroy(); // kill client after server's response
this.server.close();
diff --git a/examples/tcpsockets/android/build.gradle b/examples/tcpsockets/android/build.gradle
index ed5a568..0547dbf 100644
--- a/examples/tcpsockets/android/build.gradle
+++ b/examples/tcpsockets/android/build.gradle
@@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "29.0.2"
- minSdkVersion = 16
+ minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
}
diff --git a/examples/tcpsockets/ios/Podfile b/examples/tcpsockets/ios/Podfile
index b40173f..241d654 100644
--- a/examples/tcpsockets/ios/Podfile
+++ b/examples/tcpsockets/ios/Podfile
@@ -17,10 +17,10 @@ target 'tcpsockets' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
- use_flipper!
- post_install do |installer|
- flipper_post_install(installer)
- end
+ # use_flipper!
+ # post_install do |installer|
+ # flipper_post_install(installer)
+ # end
end
target 'tcpsockets-tvOS' do
diff --git a/examples/tcpsockets/ios/Podfile.lock b/examples/tcpsockets/ios/Podfile.lock
new file mode 100644
index 0000000..5ce89fd
--- /dev/null
+++ b/examples/tcpsockets/ios/Podfile.lock
@@ -0,0 +1,379 @@
+PODS:
+ - boost-for-react-native (1.63.0)
+ - CocoaAsyncSocket (7.6.5)
+ - DoubleConversion (1.1.6)
+ - FBLazyVector (0.63.2)
+ - FBReactNativeSpec (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - RCTRequired (= 0.63.2)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - Folly (2020.01.13.00):
+ - boost-for-react-native
+ - DoubleConversion
+ - Folly/Default (= 2020.01.13.00)
+ - glog
+ - Folly/Default (2020.01.13.00):
+ - boost-for-react-native
+ - DoubleConversion
+ - glog
+ - glog (0.3.5)
+ - RCTRequired (0.63.2)
+ - RCTTypeSafety (0.63.2):
+ - FBLazyVector (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTRequired (= 0.63.2)
+ - React-Core (= 0.63.2)
+ - React (0.63.2):
+ - React-Core (= 0.63.2)
+ - React-Core/DevSupport (= 0.63.2)
+ - React-Core/RCTWebSocket (= 0.63.2)
+ - React-RCTActionSheet (= 0.63.2)
+ - React-RCTAnimation (= 0.63.2)
+ - React-RCTBlob (= 0.63.2)
+ - React-RCTImage (= 0.63.2)
+ - React-RCTLinking (= 0.63.2)
+ - React-RCTNetwork (= 0.63.2)
+ - React-RCTSettings (= 0.63.2)
+ - React-RCTText (= 0.63.2)
+ - React-RCTVibration (= 0.63.2)
+ - React-callinvoker (0.63.2)
+ - React-Core (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default (= 0.63.2)
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/CoreModulesHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/Default (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/DevSupport (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default (= 0.63.2)
+ - React-Core/RCTWebSocket (= 0.63.2)
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - React-jsinspector (= 0.63.2)
+ - Yoga
+ - React-Core/RCTActionSheetHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTAnimationHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTBlobHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTImageHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTLinkingHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTNetworkHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTSettingsHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTTextHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTVibrationHeaders (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-Core/RCTWebSocket (0.63.2):
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-Core/Default (= 0.63.2)
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsiexecutor (= 0.63.2)
+ - Yoga
+ - React-CoreModules (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core/CoreModulesHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-RCTImage (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-cxxreact (0.63.2):
+ - boost-for-react-native (= 1.63.0)
+ - DoubleConversion
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-callinvoker (= 0.63.2)
+ - React-jsinspector (= 0.63.2)
+ - React-jsi (0.63.2):
+ - boost-for-react-native (= 1.63.0)
+ - DoubleConversion
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-jsi/Default (= 0.63.2)
+ - React-jsi/Default (0.63.2):
+ - boost-for-react-native (= 1.63.0)
+ - DoubleConversion
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-jsiexecutor (0.63.2):
+ - DoubleConversion
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-jsinspector (0.63.2)
+ - react-native-tcp-socket (4.5.5):
+ - CocoaAsyncSocket
+ - React-Core
+ - React-RCTActionSheet (0.63.2):
+ - React-Core/RCTActionSheetHeaders (= 0.63.2)
+ - React-RCTAnimation (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core/RCTAnimationHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTBlob (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - React-Core/RCTBlobHeaders (= 0.63.2)
+ - React-Core/RCTWebSocket (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-RCTNetwork (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTImage (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core/RCTImageHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - React-RCTNetwork (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTLinking (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - React-Core/RCTLinkingHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTNetwork (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core/RCTNetworkHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTSettings (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - RCTTypeSafety (= 0.63.2)
+ - React-Core/RCTSettingsHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - React-RCTText (0.63.2):
+ - React-Core/RCTTextHeaders (= 0.63.2)
+ - React-RCTVibration (0.63.2):
+ - FBReactNativeSpec (= 0.63.2)
+ - Folly (= 2020.01.13.00)
+ - React-Core/RCTVibrationHeaders (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - ReactCommon/turbomodule/core (= 0.63.2)
+ - ReactCommon/turbomodule/core (0.63.2):
+ - DoubleConversion
+ - Folly (= 2020.01.13.00)
+ - glog
+ - React-callinvoker (= 0.63.2)
+ - React-Core (= 0.63.2)
+ - React-cxxreact (= 0.63.2)
+ - React-jsi (= 0.63.2)
+ - Yoga (1.14.0)
+
+DEPENDENCIES:
+ - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
+ - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
+ - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
+ - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
+ - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
+ - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
+ - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
+ - React (from `../node_modules/react-native/`)
+ - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
+ - React-Core (from `../node_modules/react-native/`)
+ - React-Core/DevSupport (from `../node_modules/react-native/`)
+ - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
+ - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
+ - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
+ - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
+ - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
+ - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
+ - react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`)
+ - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
+ - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
+ - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
+ - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
+ - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
+ - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
+ - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
+ - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
+ - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
+ - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
+ - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
+
+SPEC REPOS:
+ trunk:
+ - boost-for-react-native
+ - CocoaAsyncSocket
+
+EXTERNAL SOURCES:
+ DoubleConversion:
+ :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
+ FBLazyVector:
+ :path: "../node_modules/react-native/Libraries/FBLazyVector"
+ FBReactNativeSpec:
+ :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
+ Folly:
+ :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
+ glog:
+ :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
+ RCTRequired:
+ :path: "../node_modules/react-native/Libraries/RCTRequired"
+ RCTTypeSafety:
+ :path: "../node_modules/react-native/Libraries/TypeSafety"
+ React:
+ :path: "../node_modules/react-native/"
+ React-callinvoker:
+ :path: "../node_modules/react-native/ReactCommon/callinvoker"
+ React-Core:
+ :path: "../node_modules/react-native/"
+ React-CoreModules:
+ :path: "../node_modules/react-native/React/CoreModules"
+ React-cxxreact:
+ :path: "../node_modules/react-native/ReactCommon/cxxreact"
+ React-jsi:
+ :path: "../node_modules/react-native/ReactCommon/jsi"
+ React-jsiexecutor:
+ :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
+ React-jsinspector:
+ :path: "../node_modules/react-native/ReactCommon/jsinspector"
+ react-native-tcp-socket:
+ :path: "../node_modules/react-native-tcp-socket"
+ React-RCTActionSheet:
+ :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
+ React-RCTAnimation:
+ :path: "../node_modules/react-native/Libraries/NativeAnimation"
+ React-RCTBlob:
+ :path: "../node_modules/react-native/Libraries/Blob"
+ React-RCTImage:
+ :path: "../node_modules/react-native/Libraries/Image"
+ React-RCTLinking:
+ :path: "../node_modules/react-native/Libraries/LinkingIOS"
+ React-RCTNetwork:
+ :path: "../node_modules/react-native/Libraries/Network"
+ React-RCTSettings:
+ :path: "../node_modules/react-native/Libraries/Settings"
+ React-RCTText:
+ :path: "../node_modules/react-native/Libraries/Text"
+ React-RCTVibration:
+ :path: "../node_modules/react-native/Libraries/Vibration"
+ ReactCommon:
+ :path: "../node_modules/react-native/ReactCommon"
+ Yoga:
+ :path: "../node_modules/react-native/ReactCommon/yoga"
+
+SPEC CHECKSUMS:
+ boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
+ CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
+ DoubleConversion: cde416483dac037923206447da6e1454df403714
+ FBLazyVector: 3ef4a7f62e7db01092f9d517d2ebc0d0677c4a37
+ FBReactNativeSpec: dc7fa9088f0f2a998503a352b0554d69a4391c5a
+ Folly: b73c3869541e86821df3c387eb0af5f65addfab4
+ glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
+ RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe
+ RCTTypeSafety: 44982c5c8e43ff4141eb519a8ddc88059acd1f3a
+ React: e1c65dd41cb9db13b99f24608e47dd595f28ca9a
+ React-callinvoker: 552a6a6bc8b3bb794cf108ad59e5a9e2e3b4fc98
+ React-Core: 9d341e725dc9cd2f49e4c49ad1fc4e8776aa2639
+ React-CoreModules: 5335e168165da7f7083ce7147768d36d3e292318
+ React-cxxreact: d3261ec5f7d11743fbf21e263a34ea51d1f13ebc
+ React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
+ React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
+ React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
+ react-native-tcp-socket: 6b4108c9000d0ad48f5ea89d3c971fb2e73da6ca
+ React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
+ React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
+ React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
+ React-RCTImage: de355d738727b09ad3692f2a979affbd54b5f378
+ React-RCTLinking: 8122f221d395a63364b2c0078ce284214bd04575
+ React-RCTNetwork: 8f96c7b49ea6a0f28f98258f347b6ad218bc0830
+ React-RCTSettings: 8a49622aff9c1925f5455fa340b6fe4853d64ab6
+ React-RCTText: 1b6773e776e4b33f90468c20fe3b16ca3e224bb8
+ React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
+ ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
+ Yoga: 7740b94929bbacbddda59bf115b5317e9a161598
+
+PODFILE CHECKSUM: 2db03545a25c6287aa07449ecb2478e79603bc86
+
+COCOAPODS: 1.10.1
diff --git a/examples/tcpsockets/ios/tcpsockets.xcodeproj/project.pbxproj b/examples/tcpsockets/ios/tcpsockets.xcodeproj/project.pbxproj
index 525ae21..4201a25 100644
--- a/examples/tcpsockets/ios/tcpsockets.xcodeproj/project.pbxproj
+++ b/examples/tcpsockets/ios/tcpsockets.xcodeproj/project.pbxproj
@@ -16,6 +16,10 @@
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DCD954D1E0B4F2C00145EB5 /* tcpsocketsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* tcpsocketsTests.m */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
+ B99B3A97229DD2F7B87C5B8B /* libPods-tcpsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A90D6B744FF7CA05E4600EB4 /* libPods-tcpsockets.a */; };
+ BDB84D855F540F4F5CBED194 /* libPods-tcpsockets-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 219D30E3A92F1E65DF995367 /* libPods-tcpsockets-tvOS.a */; };
+ CC0A3391A5353529CBEFE46D /* libPods-tcpsockets-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F814CB1DA3FF4B20B87C931 /* libPods-tcpsockets-tvOSTests.a */; };
+ D069A4A683219155E8076B73 /* libPods-tcpsockets-tcpsocketsTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6106B21248986E7F8DB7DD94 /* libPods-tcpsockets-tcpsocketsTests.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -40,15 +44,27 @@
00E356EE1AD99517003FC87E /* tcpsocketsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = tcpsocketsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
00E356F21AD99517003FC87E /* tcpsocketsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = tcpsocketsTests.m; sourceTree = ""; };
+ 137A1877FFD72636F1419680 /* Pods-tcpsockets-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tvOS.release.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tvOS/Pods-tcpsockets-tvOS.release.xcconfig"; sourceTree = ""; };
13B07F961A680F5B00A75B9A /* tcpsockets.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = tcpsockets.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = tcpsockets/AppDelegate.h; sourceTree = ""; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = tcpsockets/AppDelegate.m; sourceTree = ""; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = tcpsockets/Images.xcassets; sourceTree = ""; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = tcpsockets/Info.plist; sourceTree = ""; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = tcpsockets/main.m; sourceTree = ""; };
+ 201E2753E5A8FC4D7CDB90D8 /* Pods-tcpsockets-tcpsocketsTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tcpsocketsTests.debug.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tcpsocketsTests/Pods-tcpsockets-tcpsocketsTests.debug.xcconfig"; sourceTree = ""; };
+ 219D30E3A92F1E65DF995367 /* libPods-tcpsockets-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tcpsockets-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E47B1E0B4A5D006451C7 /* tcpsockets-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "tcpsockets-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* tcpsockets-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "tcpsockets-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 6106B21248986E7F8DB7DD94 /* libPods-tcpsockets-tcpsocketsTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tcpsockets-tcpsocketsTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 6F814CB1DA3FF4B20B87C931 /* libPods-tcpsockets-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tcpsockets-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = tcpsockets/LaunchScreen.storyboard; sourceTree = ""; };
+ 8368531CC8FA4955D538F126 /* Pods-tcpsockets-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tvOS/Pods-tcpsockets-tvOS.debug.xcconfig"; sourceTree = ""; };
+ A518DAE9D2A2993EE71D74EB /* Pods-tcpsockets-tcpsocketsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tcpsocketsTests.release.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tcpsocketsTests/Pods-tcpsockets-tcpsocketsTests.release.xcconfig"; sourceTree = ""; };
+ A90D6B744FF7CA05E4600EB4 /* libPods-tcpsockets.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tcpsockets.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ B8B1C9275C2A45BCF91CE54E /* Pods-tcpsockets.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets.debug.xcconfig"; path = "Target Support Files/Pods-tcpsockets/Pods-tcpsockets.debug.xcconfig"; sourceTree = ""; };
+ D07925D51BC0290A0E1D0B0F /* Pods-tcpsockets-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tvOSTests/Pods-tcpsockets-tvOSTests.debug.xcconfig"; sourceTree = ""; };
+ E56AC2C616A3B32B9F4806E4 /* Pods-tcpsockets.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets.release.xcconfig"; path = "Target Support Files/Pods-tcpsockets/Pods-tcpsockets.release.xcconfig"; sourceTree = ""; };
+ E79249764B956D73190A1575 /* Pods-tcpsockets-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tcpsockets-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-tcpsockets-tvOSTests/Pods-tcpsockets-tvOSTests.release.xcconfig"; sourceTree = ""; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
@@ -58,6 +74,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ D069A4A683219155E8076B73 /* libPods-tcpsockets-tcpsocketsTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -65,6 +82,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ B99B3A97229DD2F7B87C5B8B /* libPods-tcpsockets.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -72,6 +90,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ BDB84D855F540F4F5CBED194 /* libPods-tcpsockets-tvOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -79,6 +98,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ CC0A3391A5353529CBEFE46D /* libPods-tcpsockets-tvOSTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -121,6 +141,10 @@
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
+ A90D6B744FF7CA05E4600EB4 /* libPods-tcpsockets.a */,
+ 6106B21248986E7F8DB7DD94 /* libPods-tcpsockets-tcpsocketsTests.a */,
+ 219D30E3A92F1E65DF995367 /* libPods-tcpsockets-tvOS.a */,
+ 6F814CB1DA3FF4B20B87C931 /* libPods-tcpsockets-tvOSTests.a */,
);
name = Frameworks;
sourceTree = "";
@@ -140,6 +164,7 @@
00E356EF1AD99517003FC87E /* tcpsocketsTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
+ AB565C39DFD9775C38157088 /* Pods */,
);
indentWidth = 2;
sourceTree = "";
@@ -157,6 +182,22 @@
name = Products;
sourceTree = "";
};
+ AB565C39DFD9775C38157088 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ B8B1C9275C2A45BCF91CE54E /* Pods-tcpsockets.debug.xcconfig */,
+ E56AC2C616A3B32B9F4806E4 /* Pods-tcpsockets.release.xcconfig */,
+ 201E2753E5A8FC4D7CDB90D8 /* Pods-tcpsockets-tcpsocketsTests.debug.xcconfig */,
+ A518DAE9D2A2993EE71D74EB /* Pods-tcpsockets-tcpsocketsTests.release.xcconfig */,
+ 8368531CC8FA4955D538F126 /* Pods-tcpsockets-tvOS.debug.xcconfig */,
+ 137A1877FFD72636F1419680 /* Pods-tcpsockets-tvOS.release.xcconfig */,
+ D07925D51BC0290A0E1D0B0F /* Pods-tcpsockets-tvOSTests.debug.xcconfig */,
+ E79249764B956D73190A1575 /* Pods-tcpsockets-tvOSTests.release.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -164,9 +205,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "tcpsocketsTests" */;
buildPhases = (
+ 9E570CD8EE71E56ABB1183FC /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
+ 42BB03B5C30DA5C32BAB0D9B /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -182,11 +225,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "tcpsockets" */;
buildPhases = (
+ B70CC43002ED3D5D1E460CEA /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
+ B6950979BAA9507750EB8DD4 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -201,6 +246,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "tcpsockets-tvOS" */;
buildPhases = (
+ 0ED11DD9080372818EBA03AE /* [CP] Check Pods Manifest.lock */,
FD10A7F122414F3F0027D42C /* Start Packager */,
2D02E4771E0B4A5D006451C7 /* Sources */,
2D02E4781E0B4A5D006451C7 /* Frameworks */,
@@ -220,6 +266,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "tcpsockets-tvOSTests" */;
buildPhases = (
+ 3DC10C4CE3067E6D9212611D /* [CP] Check Pods Manifest.lock */,
2D02E48C1E0B4A5D006451C7 /* Sources */,
2D02E48D1E0B4A5D006451C7 /* Frameworks */,
2D02E48E1E0B4A5D006451C7 /* Resources */,
@@ -330,6 +377,28 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
+ 0ED11DD9080372818EBA03AE /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-tcpsockets-tvOS-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -344,6 +413,108 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
+ 3DC10C4CE3067E6D9212611D /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-tcpsockets-tvOSTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 42BB03B5C30DA5C32BAB0D9B /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-tcpsockets-tcpsocketsTests/Pods-tcpsockets-tcpsocketsTests-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
+ );
+ name = "[CP] Copy Pods Resources";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-tcpsockets-tcpsocketsTests/Pods-tcpsockets-tcpsocketsTests-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 9E570CD8EE71E56ABB1183FC /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-tcpsockets-tcpsocketsTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ B6950979BAA9507750EB8DD4 /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-tcpsockets/Pods-tcpsockets-resources.sh",
+ "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
+ );
+ name = "[CP] Copy Pods Resources";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-tcpsockets/Pods-tcpsockets-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ B70CC43002ED3D5D1E460CEA /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-tcpsockets-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -437,6 +608,7 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 201E2753E5A8FC4D7CDB90D8 /* Pods-tcpsockets-tcpsocketsTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -459,6 +631,7 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = A518DAE9D2A2993EE71D74EB /* Pods-tcpsockets-tcpsocketsTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
@@ -478,6 +651,7 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = B8B1C9275C2A45BCF91CE54E /* Pods-tcpsockets.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
@@ -500,6 +674,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = E56AC2C616A3B32B9F4806E4 /* Pods-tcpsockets.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
@@ -520,6 +695,7 @@
};
2D02E4971E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 8368531CC8FA4955D538F126 /* Pods-tcpsockets-tvOS.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -547,6 +723,7 @@
};
2D02E4981E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 137A1877FFD72636F1419680 /* Pods-tcpsockets-tvOS.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -574,6 +751,7 @@
};
2D02E4991E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = D07925D51BC0290A0E1D0B0F /* Pods-tcpsockets-tvOSTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
@@ -600,6 +778,7 @@
};
2D02E49A1E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = E79249764B956D73190A1575 /* Pods-tcpsockets-tvOSTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
diff --git a/examples/tcpsockets/package.json b/examples/tcpsockets/package.json
index 710d2b8..581eaf3 100644
--- a/examples/tcpsockets/package.json
+++ b/examples/tcpsockets/package.json
@@ -14,7 +14,7 @@
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.2",
- "react-native-tcp-socket": "^4.3.0"
+ "react-native-tcp-socket": "^4.5.7"
},
"devDependencies": {
"@babel/core": "^7.8.4",
diff --git a/examples/tcpsockets/yarn.lock b/examples/tcpsockets/yarn.lock
index f0cb0fd..536174c 100644
--- a/examples/tcpsockets/yarn.lock
+++ b/examples/tcpsockets/yarn.lock
@@ -1706,11 +1706,16 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
-base64-js@^1.0.2, base64-js@^1.1.2, base64-js@^1.2.3:
+base64-js@^1.1.2, base64-js@^1.2.3:
version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
+base64-js@^1.3.1:
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
+ integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
+
base@^0.11.1:
version "0.11.2"
resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
@@ -1818,12 +1823,12 @@ buffer-from@^1.0.0:
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
buffer@^5.4.3:
- version "5.6.0"
- resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786"
- integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0"
+ integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
dependencies:
- base64-js "^1.0.2"
- ieee754 "^1.1.4"
+ base64-js "^1.3.1"
+ ieee754 "^1.1.13"
bytes@3.0.0:
version "3.0.0"
@@ -3267,10 +3272,10 @@ iconv-lite@^0.6.2:
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
-ieee754@^1.1.4:
- version "1.1.13"
- resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
- integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
+ieee754@^1.1.13:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
+ integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
ignore@^4.0.6:
version "4.0.6"
@@ -5477,10 +5482,10 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
-react-native-tcp-socket@^4.3.0:
- version "4.3.0"
- resolved "https://registry.yarnpkg.com/react-native-tcp-socket/-/react-native-tcp-socket-4.3.0.tgz#21c4ab6327ab68e80f0a0f7e4acde75c5c8e0918"
- integrity sha512-B3W6ArT6RlPaM3lA/4lWk+Dqx35rvqxneBw5WSFjKk2gf0LmXaGngzsxqkiMtPqzdn3TU/ufrZ8Ev2/okKHQnA==
+react-native-tcp-socket@^4.5.7:
+ version "4.5.7"
+ resolved "https://registry.yarnpkg.com/react-native-tcp-socket/-/react-native-tcp-socket-4.5.7.tgz#3ad0326eaa6aa49c2d3ba4fcd660a56f7b3f26e8"
+ integrity sha512-FztCwV/pSurnUxVDSKWlfpovU5QfBjQRf/A+gQn7mvUANB4eaxbILFk1zXCrW4/Hu5FGNPBSI82kaWxRHgoelA==
dependencies:
buffer "^5.4.3"
events "^3.1.0"
diff --git a/ios/Podfile b/ios/Podfile
index 2b2207e..76f84ae 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -1,20 +1,16 @@
+require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'TcpSockets' do
# Comment the next line if you don't want to use dynamic frameworks
- use_frameworks!
+ # use_frameworks!
pod 'CocoaAsyncSocket'
# Necessary for react-native
- pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
- pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
- pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
- pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
- pod 'React-Core', :path => '../node_modules/react-native/'
- pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
- pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
+ pod 'React-Core', :path => '../node_modules/react-native/React'
+ pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
@@ -24,15 +20,13 @@ target 'TcpSockets' do
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
- pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
+ pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
- pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
- pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
- pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
+ pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index fc16322..dcdacf2 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -2,14 +2,6 @@ PODS:
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.3)
- DoubleConversion (1.1.6)
- - FBLazyVector (0.61.5)
- - FBReactNativeSpec (0.61.5):
- - Folly (= 2018.10.22.00)
- - RCTRequired (= 0.61.5)
- - RCTTypeSafety (= 0.61.5)
- - React-Core (= 0.61.5)
- - React-jsi (= 0.61.5)
- - ReactCommon/turbomodule/core (= 0.61.5)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
@@ -20,221 +12,85 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- - RCTRequired (0.61.5)
- - RCTTypeSafety (0.61.5):
- - FBLazyVector (= 0.61.5)
- - Folly (= 2018.10.22.00)
- - RCTRequired (= 0.61.5)
- - React-Core (= 0.61.5)
- - React (0.61.5):
- - React-Core (= 0.61.5)
- - React-Core/DevSupport (= 0.61.5)
- - React-Core/RCTWebSocket (= 0.61.5)
- - React-RCTActionSheet (= 0.61.5)
- - React-RCTAnimation (= 0.61.5)
- - React-RCTBlob (= 0.61.5)
- - React-RCTImage (= 0.61.5)
- - React-RCTLinking (= 0.61.5)
- - React-RCTNetwork (= 0.61.5)
- - React-RCTSettings (= 0.61.5)
- - React-RCTText (= 0.61.5)
- - React-RCTVibration (= 0.61.5)
- - React-Core (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default (= 0.61.5)
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/CoreModulesHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/Default (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/DevSupport (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default (= 0.61.5)
- - React-Core/RCTWebSocket (= 0.61.5)
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - React-jsinspector (= 0.61.5)
- - Yoga
- - React-Core/RCTActionSheetHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTAnimationHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTBlobHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTImageHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTLinkingHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTNetworkHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTSettingsHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTTextHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTVibrationHeaders (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-Core/RCTWebSocket (0.61.5):
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core/Default (= 0.61.5)
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsiexecutor (= 0.61.5)
- - Yoga
- - React-CoreModules (0.61.5):
- - FBReactNativeSpec (= 0.61.5)
- - Folly (= 2018.10.22.00)
- - RCTTypeSafety (= 0.61.5)
- - React-Core/CoreModulesHeaders (= 0.61.5)
- - React-RCTImage (= 0.61.5)
- - ReactCommon/turbomodule/core (= 0.61.5)
- - React-cxxreact (0.61.5):
+ - React (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-DevSupport (= 0.60.5)
+ - React-RCTActionSheet (= 0.60.5)
+ - React-RCTAnimation (= 0.60.5)
+ - React-RCTBlob (= 0.60.5)
+ - React-RCTImage (= 0.60.5)
+ - React-RCTLinking (= 0.60.5)
+ - React-RCTNetwork (= 0.60.5)
+ - React-RCTSettings (= 0.60.5)
+ - React-RCTText (= 0.60.5)
+ - React-RCTVibration (= 0.60.5)
+ - React-RCTWebSocket (= 0.60.5)
+ - React-Core (0.60.5):
+ - Folly (= 2018.10.22.00)
+ - React-cxxreact (= 0.60.5)
+ - React-jsiexecutor (= 0.60.5)
+ - yoga (= 0.60.5.React)
+ - React-cxxreact (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- - React-jsinspector (= 0.61.5)
- - React-jsi (0.61.5):
+ - React-jsinspector (= 0.60.5)
+ - React-DevSupport (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTWebSocket (= 0.60.5)
+ - React-jsi (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- - React-jsi/Default (= 0.61.5)
- - React-jsi/Default (0.61.5):
+ - React-jsi/Default (= 0.60.5)
+ - React-jsi/Default (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- - React-jsiexecutor (0.61.5):
- - DoubleConversion
- - Folly (= 2018.10.22.00)
- - glog
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-jsinspector (0.61.5)
- - React-RCTActionSheet (0.61.5):
- - React-Core/RCTActionSheetHeaders (= 0.61.5)
- - React-RCTAnimation (0.61.5):
- - React-Core/RCTAnimationHeaders (= 0.61.5)
- - React-RCTBlob (0.61.5):
- - React-Core/RCTBlobHeaders (= 0.61.5)
- - React-Core/RCTWebSocket (= 0.61.5)
- - React-jsi (= 0.61.5)
- - React-RCTNetwork (= 0.61.5)
- - React-RCTImage (0.61.5):
- - React-Core/RCTImageHeaders (= 0.61.5)
- - React-RCTNetwork (= 0.61.5)
- - React-RCTLinking (0.61.5):
- - React-Core/RCTLinkingHeaders (= 0.61.5)
- - React-RCTNetwork (0.61.5):
- - React-Core/RCTNetworkHeaders (= 0.61.5)
- - React-RCTSettings (0.61.5):
- - React-Core/RCTSettingsHeaders (= 0.61.5)
- - React-RCTText (0.61.5):
- - React-Core/RCTTextHeaders (= 0.61.5)
- - React-RCTVibration (0.61.5):
- - React-Core/RCTVibrationHeaders (= 0.61.5)
- - ReactCommon/jscallinvoker (0.61.5):
+ - React-jsiexecutor (0.60.5):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- - React-cxxreact (= 0.61.5)
- - ReactCommon/turbomodule/core (0.61.5):
- - DoubleConversion
- - Folly (= 2018.10.22.00)
- - glog
- - React-Core (= 0.61.5)
- - React-cxxreact (= 0.61.5)
- - React-jsi (= 0.61.5)
- - ReactCommon/jscallinvoker (= 0.61.5)
- - Yoga (1.14.0)
+ - React-cxxreact (= 0.60.5)
+ - React-jsi (= 0.60.5)
+ - React-jsinspector (0.60.5)
+ - React-RCTActionSheet (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTAnimation (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTBlob (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTNetwork (= 0.60.5)
+ - React-RCTWebSocket (= 0.60.5)
+ - React-RCTImage (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTNetwork (= 0.60.5)
+ - React-RCTLinking (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTNetwork (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTSettings (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTText (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTVibration (0.60.5):
+ - React-Core (= 0.60.5)
+ - React-RCTWebSocket (0.60.5):
+ - React-Core (= 0.60.5)
+ - yoga (0.60.5.React)
DEPENDENCIES:
- CocoaAsyncSocket
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`)
- - React-Core (from `../node_modules/react-native/`)
- - React-Core/DevSupport (from `../node_modules/react-native/`)
- - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
+ - React-Core (from `../node_modules/react-native/React`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
+ - React-DevSupport (from `../node_modules/react-native/React`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
@@ -247,9 +103,8 @@ DEPENDENCIES:
- React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
- - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
+ - React-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`)
+ - yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
trunk:
@@ -259,26 +114,18 @@ SPEC REPOS:
EXTERNAL SOURCES:
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
- FBLazyVector:
- :path: "../node_modules/react-native/Libraries/FBLazyVector"
- FBReactNativeSpec:
- :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
- RCTRequired:
- :path: "../node_modules/react-native/Libraries/RCTRequired"
- RCTTypeSafety:
- :path: "../node_modules/react-native/Libraries/TypeSafety"
React:
:path: "../node_modules/react-native/"
React-Core:
- :path: "../node_modules/react-native/"
- React-CoreModules:
- :path: "../node_modules/react-native/React/CoreModules"
+ :path: "../node_modules/react-native/React"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
+ React-DevSupport:
+ :path: "../node_modules/react-native/React"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
@@ -303,40 +150,36 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/Text"
React-RCTVibration:
:path: "../node_modules/react-native/Libraries/Vibration"
- ReactCommon:
- :path: "../node_modules/react-native/ReactCommon"
- Yoga:
+ React-RCTWebSocket:
+ :path: "../node_modules/react-native/Libraries/WebSocket"
+ yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: eafaa68a7e0ec99ead0a7b35015e0bf25d2c8987
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
- FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f
- FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
- RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
- RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
- React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
- React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04
- React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb
- React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7
- React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
- React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
- React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
- React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
- React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
- React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
- React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e
- React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5
- React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a
- React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640
- React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
- React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
- ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
- Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
+ React: 53c53c4d99097af47cf60594b8706b4e3321e722
+ React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64
+ React-cxxreact: 8384287780c4999351ad9b6e7a149d9ed10a2395
+ React-DevSupport: 197fb409737cff2c4f9986e77c220d7452cb9f9f
+ React-jsi: 4d8c9efb6312a9725b18d6fc818ffc103f60fec2
+ React-jsiexecutor: 90ad2f9db09513fc763bc757fdc3c4ff8bde2a30
+ React-jsinspector: e08662d1bf5b129a3d556eb9ea343a3f40353ae4
+ React-RCTActionSheet: b0f1ea83f4bf75fb966eae9bfc47b78c8d3efd90
+ React-RCTAnimation: 359ba1b5690b1e87cc173558a78e82d35919333e
+ React-RCTBlob: 5e2b55f76e9a1c7ae52b826923502ddc3238df24
+ React-RCTImage: f5f1c50922164e89bdda67bcd0153952a5cfe719
+ React-RCTLinking: d0ecbd791e9ddddc41fa1f66b0255de90e8ee1e9
+ React-RCTNetwork: e26946300b0ab7bb6c4a6348090e93fa21f33a9d
+ React-RCTSettings: d0d37cb521b7470c998595a44f05847777cc3f42
+ React-RCTText: b074d89033583d4f2eb5faf7ea2db3a13c7553a2
+ React-RCTVibration: 2105b2e0e2b66a6408fc69a46c8a7fb5b2fdade0
+ React-RCTWebSocket: cd932a16b7214898b6b7f788c8bddb3637246ac4
+ yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411
-PODFILE CHECKSUM: c17fa9414d86be6752251d37471f1e2e374a215b
+PODFILE CHECKSUM: ec697f1a6d70fca6aa87cd981edf0d840d9e4081
COCOAPODS: 1.8.4
diff --git a/ios/TcpSocketClient.h b/ios/TcpSocketClient.h
index 2c1b3b8..17825be 100644
--- a/ios/TcpSocketClient.h
+++ b/ios/TcpSocketClient.h
@@ -22,6 +22,7 @@ typedef enum RCTTCPError RCTTCPError;
@protocol SocketClientDelegate
- (void)onConnect:(TcpSocketClient*)client;
+- (void)onListen:(TcpSocketClient*)server;
- (void)onConnection:(TcpSocketClient*)client toClient:(NSNumber *)clientID;
- (void)onData:(NSNumber *)clientID data:(NSData *)data;
- (void)onClose:(TcpSocketClient*)client withError:(NSError *)err;
@@ -35,6 +36,8 @@ typedef enum RCTTCPError RCTTCPError;
@property (nonatomic, retain) NSNumber * id;
@property (nonatomic, weak) id clientDelegate;
+- (GCDAsyncSocket *) getSocket;
+
///---------------------------------------------------------------------------------------
/// @name Class Methods
///---------------------------------------------------------------------------------------
diff --git a/ios/TcpSocketClient.m b/ios/TcpSocketClient.m
index bbcbb0d..6c69aec 100644
--- a/ios/TcpSocketClient.m
+++ b/ios/TcpSocketClient.m
@@ -26,6 +26,11 @@ - (id)initWithClientId:(NSNumber *)clientID andConfig:(id)
@implementation TcpSocketClient
+- (GCDAsyncSocket *) getSocket
+{
+ return _tcpSocket;
+}
+
+ (id)socketClientWithId:(nonnull NSNumber *)clientID andConfig:(id)delegate
{
return [[[self class] alloc] initWithClientId:clientID andConfig:delegate andSocket:nil];
@@ -144,7 +149,7 @@ - (void)setKeepAlive:(BOOL)enable initialDelay:(int)initialDelay
int on = enable ? 1 : 0;
int enableKA = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
// `initialDelay` is ignored
- if (enableKA == -1) {
+ if (enableKA == -1) {
/* TODO: handle error */
RCTLogWarn(@"react-native-tcp-socket: setKeepAlive() caused an unexpected error");
}
@@ -174,7 +179,7 @@ - (BOOL)listen:(NSDictionary *)options error:(NSError **)error
}
BOOL isListening = [_tcpSocket acceptOnInterface:host port:port error:error];
if (isListening == YES) {
- [_clientDelegate onConnect: self];
+ [_clientDelegate onListen: self];
[_tcpSocket readDataWithTimeout:-1 tag:_id.longValue];
}
diff --git a/ios/TcpSockets.m b/ios/TcpSockets.m
index 5666e30..5295841 100644
--- a/ios/TcpSockets.m
+++ b/ios/TcpSockets.m
@@ -20,6 +20,7 @@ @implementation TcpSockets
- (NSArray *)supportedEvents
{
return @[@"connect",
+ @"listening",
@"connection",
@"data",
@"close",
@@ -47,18 +48,18 @@ - (TcpSocketClient *)createSocket:(nonnull NSNumber*)cId
RCTLogWarn(@"%@.createSocket called with nil id parameter.", [self class]);
return nil;
}
-
+
if (!_clients) {
_clients = [NSMutableDictionary new];
}
-
+
if (_clients[cId]) {
RCTLogWarn(@"%@.createSocket called twice with the same id.", [self class]);
return nil;
}
-
+
_clients[cId] = [TcpSocketClient socketClientWithId:cId andConfig:self];
-
+
return _clients[cId];
}
@@ -69,9 +70,9 @@ - (TcpSocketClient *)createSocket:(nonnull NSNumber*)cId
{
TcpSocketClient *client = _clients[cId];
if (!client) {
- client = [self createSocket:cId];
+ client = [self createSocket:cId];
}
-
+
NSError *error = nil;
if (![client connect:host port:port withOptions:options error:&error])
{
@@ -85,7 +86,7 @@ - (TcpSocketClient *)createSocket:(nonnull NSNumber*)cId
callback:(RCTResponseSenderBlock)callback) {
TcpSocketClient* client = [self findClient:cId];
if (!client) return;
-
+
// iOS7+
// TODO: use https://github.com/nicklockwood/Base64 for compatibility with earlier iOS versions
NSData *data = [[NSData alloc] initWithBase64EncodedString:base64String options:0];
@@ -100,14 +101,18 @@ - (TcpSocketClient *)createSocket:(nonnull NSNumber*)cId
[self destroyClient:cId];
}
+RCT_EXPORT_METHOD(close:(nonnull NSNumber*)cId) {
+ [self destroyClient:cId];
+}
+
RCT_EXPORT_METHOD(listen:(nonnull NSNumber*)cId
withOptions:(nonnull NSDictionary *)options)
{
TcpSocketClient* client = _clients[cId];
if (!client) {
- client = [self createSocket:cId];
+ client = [self createSocket:cId];
}
-
+
NSError *error = nil;
if (![client listen:options error:&error])
{
@@ -132,15 +137,46 @@ - (TcpSocketClient *)createSocket:(nonnull NSNumber*)cId
- (void)onConnect:(TcpSocketClient*) client
{
- [self sendEventWithName:@"connect"
- body:@{ @"id": client.id, @"address" : [client getAddress] }];
+ GCDAsyncSocket * socket = [client getSocket];
+ [self sendEventWithName:@"connect" body:@{
+ @"id": client.id,
+ @"connection": @{
+ @"localAddress": [socket localHost],
+ @"localPort": [NSNumber numberWithInt:[socket localPort]],
+ @"remoteAddress": [socket connectedHost],
+ @"remotePort": [NSNumber numberWithInt:[socket connectedPort]],
+ @"remoteFamily": [socket isIPv4] ? @"IPv4" : @"IPv6"
+ } }];
+}
+
+- (void) onListen:(TcpSocketClient*) server
+{
+ GCDAsyncSocket * socket = [server getSocket];
+ [self sendEventWithName:@"listening" body:@{
+ @"id": server.id,
+ @"connection": @{
+ @"localAddress": [socket localHost],
+ @"localPort": [NSNumber numberWithInt:[socket localPort]],
+ @"localFamily": [socket isIPv4] ? @"IPv4" : @"IPv6"
+ } }];
}
-(void)onConnection:(TcpSocketClient *)client toClient:(NSNumber *)clientID {
_clients[client.id] = client;
-
- [self sendEventWithName:@"connection"
- body:@{ @"id": clientID, @"info": @{ @"id": client.id, @"address" : [client getAddress] } }];
+
+ GCDAsyncSocket * socket = [client getSocket];
+
+ [self sendEventWithName:@"connection" body:@{
+ @"id": clientID,
+ @"info": @{
+ @"id": client.id,
+ @"connection": @{
+ @"localAddress": [socket localHost],
+ @"localPort": [NSNumber numberWithInt:[socket localPort]],
+ @"remoteAddress": [socket connectedHost],
+ @"remotePort": [NSNumber numberWithInt:[socket connectedPort]],
+ @"remoteFamily": [socket isIPv4] ? @"IPv4" : @"IPv6"
+ } }}];
}
- (void)onData:(NSNumber *)clientID data:(NSData *)data
@@ -156,14 +192,14 @@ - (void)onClose:(NSNumber*) clientID withError:(NSError *)err
if (!client) {
RCTLogWarn(@"onClose: unrecognized client id %@", clientID);
}
-
+
if (err) {
[self onError:client withError:err];
}
-
+
[self sendEventWithName:@"close"
body:@{ @"id": clientID, @"hadError": err == nil ? @NO : @YES }];
-
+
[_clients removeObjectForKey:clientID];
}
@@ -171,7 +207,7 @@ - (void)onError:(TcpSocketClient*) client withError:(NSError *)err {
NSString *msg = err.localizedFailureReason ?: err.localizedDescription;
[self sendEventWithName:@"error"
body:@{ @"id": client.id, @"error": msg }];
-
+
}
-(TcpSocketClient*)findClient:(nonnull NSNumber*)cId
@@ -181,10 +217,10 @@ -(TcpSocketClient*)findClient:(nonnull NSNumber*)cId
NSString *msg = [NSString stringWithFormat:@"no client found with id %@", cId];
[self sendEventWithName:@"error"
body:@{ @"id": cId, @"error": msg }];
-
+
return nil;
}
-
+
return client;
}
@@ -192,7 +228,7 @@ -(void)endClient:(nonnull NSNumber*)cId
{
TcpSocketClient* client = [self findClient:cId];
if (!client) return;
-
+
[client end];
}
@@ -200,7 +236,7 @@ -(void)destroyClient:(nonnull NSNumber*)cId
{
TcpSocketClient* client = [self findClient:cId];
if (!client) return;
-
+
[client destroy];
}
diff --git a/ios/TcpSockets.xcodeproj/project.pbxproj b/ios/TcpSockets.xcodeproj/project.pbxproj
index e07f111..d657b25 100644
--- a/ios/TcpSockets.xcodeproj/project.pbxproj
+++ b/ios/TcpSockets.xcodeproj/project.pbxproj
@@ -10,7 +10,7 @@
13BE3DEE1AC21097009241FE /* TcpSockets.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* TcpSockets.m */; };
7350006B1AFF9AB600ED3C82 /* TcpSocketClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7350006A1AFF9AB600ED3C82 /* TcpSocketClient.m */; };
73D9377D1AFF9EBE00450142 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73D9377C1AFF9EBE00450142 /* CFNetwork.framework */; };
- A3BFD955B1256CDF4A661141 /* Pods_TcpSockets.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 306C7081FE46E252ED0AA4EC /* Pods_TcpSockets.framework */; };
+ CC0460832375F0F720EAF9FA /* libPods-TcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8083C2983F490E844575FE22 /* libPods-TcpSockets.a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,11 +31,11 @@
13BE3DED1AC21097009241FE /* TcpSockets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TcpSockets.m; sourceTree = ""; };
187C1E19BAD8D55704A1DF42 /* Pods-TcpSockets.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TcpSockets.debug.xcconfig"; path = "Target Support Files/Pods-TcpSockets/Pods-TcpSockets.debug.xcconfig"; sourceTree = ""; };
21FB648B23550434005D9173 /* React */ = {isa = PBXFileReference; lastKnownFileType = folder; name = React; path = "../node_modules/react-native/React"; sourceTree = ""; };
- 306C7081FE46E252ED0AA4EC /* Pods_TcpSockets.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TcpSockets.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4290C7B94EC5D125995B2E0E /* Pods-TcpSockets.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TcpSockets.release.xcconfig"; path = "Target Support Files/Pods-TcpSockets/Pods-TcpSockets.release.xcconfig"; sourceTree = ""; };
735000691AFF9AB600ED3C82 /* TcpSocketClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpSocketClient.h; sourceTree = ""; };
7350006A1AFF9AB600ED3C82 /* TcpSocketClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TcpSocketClient.m; sourceTree = ""; };
73D9377C1AFF9EBE00450142 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ 8083C2983F490E844575FE22 /* libPods-TcpSockets.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TcpSockets.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -44,7 +44,7 @@
buildActionMask = 2147483647;
files = (
73D9377D1AFF9EBE00450142 /* CFNetwork.framework in Frameworks */,
- A3BFD955B1256CDF4A661141 /* Pods_TcpSockets.framework in Frameworks */,
+ CC0460832375F0F720EAF9FA /* libPods-TcpSockets.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -63,7 +63,7 @@
isa = PBXGroup;
children = (
21FB648B23550434005D9173 /* React */,
- 306C7081FE46E252ED0AA4EC /* Pods_TcpSockets.framework */,
+ 8083C2983F490E844575FE22 /* libPods-TcpSockets.a */,
);
name = Frameworks;
sourceTree = "";
diff --git a/package.json b/package.json
index 6552bbe..f09b293 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,7 @@
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.0",
"@semantic-release/npm": "^7.0.0",
- "@types/events": "^3.0.0",
+ "@types/eventemitter3": "^2.0.2",
"@types/jest": "^25.1.3",
"@types/react-native": "^0.61.17",
"babel-eslint": "^10.1.0",
@@ -75,12 +75,12 @@
"metro-react-native-babel-preset": "^0.58.0",
"prettier": "^1.18.2",
"react": "16.9.0",
- "react-native": "0.60.0",
+ "react-native": "0.60.5",
"semantic-release": "^17.0.1",
"typescript": "^4.1.3"
},
"dependencies": {
"buffer": "^5.4.3",
- "events": "^3.1.0"
+ "eventemitter3": "^4.0.7"
}
}
diff --git a/src/TcpServer.js b/src/TcpServer.js
index c8abaec..ea92271 100644
--- a/src/TcpServer.js
+++ b/src/TcpServer.js
@@ -1,56 +1,51 @@
'use strict';
import { NativeModules } from 'react-native';
+import EventEmitter from 'eventemitter3';
const Sockets = NativeModules.TcpSockets;
import TcpSocket from './TcpSocket';
/**
* @typedef {import('react-native').NativeEventEmitter} NativeEventEmitter
+ *
+ * @extends {EventEmitter<'connection' | 'listening' | 'error' | 'close', any>}
*/
-export default class TcpServer extends TcpSocket {
+export default class TcpServer extends EventEmitter {
/**
* @param {number} id
* @param {NativeEventEmitter} eventEmitter
* @param {(socket: TcpSocket) => void} connectionCallback
*/
constructor(id, eventEmitter, connectionCallback) {
- super(id, eventEmitter);
+ super();
+ /** @private */
+ this._id = id;
+ /** @private */
+ this._eventEmitter = eventEmitter;
this.connectionCallback = connectionCallback;
/** @type {TcpSocket[]} */
this._connections = [];
+ /** @private */
this._eventEmitter = eventEmitter;
- }
-
- /**
- * @override
- */
- _registerEvents() {
- super._registerEvents();
- this._connectionsListener = this._eventEmitter.addListener('connection', (evt) => {
- if (evt.id !== this._id) return;
- this._onConnection(evt.info);
- this.emit('connection', evt.info);
- });
- }
-
- /**
- * @override
- */
- _unregisterEvents() {
- super._unregisterEvents();
- this._connectionsListener?.remove();
+ /** @private */
+ this._localAddress = undefined;
+ /** @private */
+ this._localPort = undefined;
+ /** @private */
+ this._localFamily = undefined;
+ this._registerEvents();
}
/**
* @param {{ port: number; host: string; reuseAddress?: boolean}} options
- * @param {(arg0: any) => void} [callback]
+ * @param {() => void} [callback]
* @returns {TcpServer}
*/
listen(options, callback) {
const gotOptions = { ...options };
gotOptions.host = gotOptions.host || '0.0.0.0';
- this.once('connect', (ev) => {
- if (callback) callback(ev.address);
+ this.once('listening', () => {
+ if (callback) callback();
});
Sockets.listen(this._id, gotOptions);
return this;
@@ -64,18 +59,16 @@ export default class TcpServer extends TcpSocket {
}
close() {
- this.destroy();
+ Sockets.close(this._id);
this._connections.forEach((clientSocket) => clientSocket.destroy());
}
/**
- * @private
- * @param {{ id: number; address: string; }} info
+ * @returns {import('./TcpSocket').AddressInfo | null}
*/
- _onConnection(info) {
- const socket = new TcpSocket(info.id, this._eventEmitter, info.address);
- this._connections.push(socket);
- this.connectionCallback(socket);
+ address() {
+ if (!this._localAddress) return null;
+ return { address: this._localAddress, port: this._localPort, family: this._localFamily };
}
ref() {
@@ -85,4 +78,61 @@ export default class TcpServer extends TcpSocket {
unref() {
console.warn('react-native-tcp-socket: TcpServer.unref() method will have no effect.');
}
+
+ /**
+ * @private
+ */
+ _registerEvents() {
+ this._errorListener = this._eventEmitter.addListener('listening', (evt) => {
+ if (evt.id !== this._id) return;
+ this._localAddress = evt.connection.localAddress;
+ this._localPort = evt.connection.localPort;
+ this._localFamily = evt.connection.localFamily;
+ this.emit('listening');
+ });
+ this._errorListener = this._eventEmitter.addListener('error', (evt) => {
+ if (evt.id !== this._id) return;
+ this.close();
+ this.emit('error', evt.error);
+ });
+ this._closeListener = this._eventEmitter.addListener('close', (evt) => {
+ if (evt.id !== this._id) return;
+ this._setDisconnected();
+ this.emit('close', evt.error);
+ });
+ this._connectionsListener = this._eventEmitter.addListener('connection', (evt) => {
+ if (evt.id !== this._id) return;
+ this._onConnection(evt.info);
+ this.emit('connection', evt.info);
+ });
+ }
+
+ /**
+ * @private
+ */
+ _unregisterEvents() {
+ this._errorListener?.remove();
+ this._closeListener?.remove();
+ this._connectionsListener?.remove();
+ }
+
+ /**
+ * @private
+ */
+ _setDisconnected() {
+ this._unregisterEvents();
+ this._localAddress = undefined;
+ this._localPort = undefined;
+ this._localFamily = undefined;
+ }
+
+ /**
+ * @private
+ * @param {{ id: number; connection: import('./TcpSocket').NativeConnectionInfo; }} info
+ */
+ _onConnection(info) {
+ const socket = new TcpSocket(info.id, this._eventEmitter, info.connection);
+ this._connections.push(socket);
+ this.connectionCallback(socket);
+ }
}
diff --git a/src/TcpSocket.js b/src/TcpSocket.js
index 85fb109..3455d42 100644
--- a/src/TcpSocket.js
+++ b/src/TcpSocket.js
@@ -1,7 +1,7 @@
'use strict';
import { NativeModules, Image } from 'react-native';
-import { EventEmitter } from 'events';
+import EventEmitter from 'eventemitter3';
import { Buffer } from 'buffer';
const Sockets = NativeModules.TcpSockets;
@@ -16,6 +16,10 @@ const STATE = {
*
* @typedef {import('react-native').NativeEventEmitter} NativeEventEmitter
*
+ * @typedef {{address: string, family: string, port: number}} AddressInfo
+ *
+ * @typedef {{localAddress: string, localPort: number, remoteAddress: string, remotePort: number, remoteFamily: string}} NativeConnectionInfo
+ *
* @typedef {{
* port: number;
* host?: string;
@@ -28,6 +32,8 @@ const STATE = {
* tlsCheckValidity?: boolean,
* tlsCert?: any,
* }} ConnectionOptions
+ *
+ * @extends {EventEmitter<'connect' | 'timeout' | 'data' | 'error' | 'close', any>}
*/
export default class TcpSocket extends EventEmitter {
/**
@@ -35,13 +41,13 @@ export default class TcpSocket extends EventEmitter {
*
* @param {number} id
* @param {NativeEventEmitter} eventEmitter
- * @param {string} [address]
+ * @param {NativeConnectionInfo} [connectionInfo]
*/
- constructor(id, eventEmitter, address) {
+ constructor(id, eventEmitter, connectionInfo) {
super();
- /** @protected */
+ /** @private */
this._id = id;
- /** @protected */
+ /** @private */
this._eventEmitter = eventEmitter;
/** @type {number} @private */
this._timeoutMsecs = 0;
@@ -51,59 +57,26 @@ export default class TcpSocket extends EventEmitter {
this._state = STATE.DISCONNECTED;
/** @private */
this._encoding = undefined;
+ this.localAddress = undefined;
+ this.localPort = undefined;
+ this.remoteAddress = undefined;
+ this.remotePort = undefined;
+ this.remoteFamily = undefined;
this._registerEvents();
- if (address != undefined) this._setConnected(address);
- }
-
- /**
- * @protected
- */
- _registerEvents() {
- this._unregisterEvents();
- this._dataListener = this._eventEmitter.addListener('data', (evt) => {
- if (evt.id !== this._id) return;
- const bufferTest = Buffer.from(evt.data, 'base64');
- const finalData = this._encoding ? bufferTest.toString(this._encoding) : bufferTest;
- this.emit('data', finalData);
- });
- this._errorListener = this._eventEmitter.addListener('error', (evt) => {
- if (evt.id !== this._id) return;
- this._onError();
- this.emit('error', evt.error);
- });
- this._closeListener = this._eventEmitter.addListener('close', (evt) => {
- if (evt.id !== this._id) return;
- this._onClose();
- this.emit('close', evt.error);
- });
- this._connectListener = this._eventEmitter.addListener('connect', (evt) => {
- if (evt.id !== this._id) return;
- this._onConnect(evt.address);
- this.emit('connect', evt.address);
- });
- }
-
- /**
- * @protected
- */
- _unregisterEvents() {
- this._dataListener?.remove();
- this._errorListener?.remove();
- this._closeListener?.remove();
- this._connectListener?.remove();
+ if (connectionInfo != undefined) this._setConnected(connectionInfo);
}
/**
* @param {ConnectionOptions} options
- * @param {(address: string) => void} [callback]
+ * @param {() => void} [callback]
*/
connect(options, callback) {
const customOptions = { ...options };
// Normalize args
customOptions.host = customOptions.host || 'localhost';
customOptions.port = Number(customOptions.port) || 0;
- this.once('connect', (ev) => {
- if (callback) callback(ev.address);
+ this.once('connect', () => {
+ if (callback) callback();
});
// Timeout
if (customOptions.timeout) this.setTimeout(customOptions.timeout);
@@ -221,8 +194,15 @@ export default class TcpSocket extends EventEmitter {
return this;
}
+ /**
+ * Returns the bound `address`, the address `family` name and `port` of the socket as reported
+ * by the operating system: `{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
+ *
+ * @returns {AddressInfo | {}}
+ */
address() {
- return this._address;
+ if (!this.localAddress) return {};
+ return { address: this.localAddress, family: this.remoteFamily, port: this.localPort };
}
/**
@@ -251,28 +231,6 @@ export default class TcpSocket extends EventEmitter {
}
}
- /**
- * @private
- * @param {string} address
- */
- _onConnect(address) {
- this._setConnected(address);
- }
-
- /**
- * @private
- */
- _onClose() {
- this._setDisconnected();
- }
-
- /**
- * @private
- */
- _onError() {
- this.destroy();
- }
-
/**
* Sends data on the socket. The second parameter specifies the encoding in the case of a string — it defaults to UTF8 encoding.
*
@@ -304,6 +262,52 @@ export default class TcpSocket extends EventEmitter {
);
}
+ ref() {
+ console.warn('react-native-tcp-socket: TcpSocket.ref() method will have no effect.');
+ }
+
+ unref() {
+ console.warn('react-native-tcp-socket: TcpSocket.unref() method will have no effect.');
+ }
+
+ /**
+ * @private
+ */
+ _registerEvents() {
+ this._unregisterEvents();
+ this._dataListener = this._eventEmitter.addListener('data', (evt) => {
+ if (evt.id !== this._id) return;
+ const bufferTest = Buffer.from(evt.data, 'base64');
+ const finalData = this._encoding ? bufferTest.toString(this._encoding) : bufferTest;
+ this.emit('data', finalData);
+ });
+ this._errorListener = this._eventEmitter.addListener('error', (evt) => {
+ if (evt.id !== this._id) return;
+ this.destroy();
+ this.emit('error', evt.error);
+ });
+ this._closeListener = this._eventEmitter.addListener('close', (evt) => {
+ if (evt.id !== this._id) return;
+ this._setDisconnected();
+ this.emit('close', evt.error);
+ });
+ this._connectListener = this._eventEmitter.addListener('connect', (evt) => {
+ if (evt.id !== this._id) return;
+ this._setConnected(evt.connection);
+ this.emit('connect');
+ });
+ }
+
+ /**
+ * @private
+ */
+ _unregisterEvents() {
+ this._dataListener?.remove();
+ this._errorListener?.remove();
+ this._closeListener?.remove();
+ this._connectListener?.remove();
+ }
+
/**
* @private
* @param {string | Buffer | Uint8Array} buffer
@@ -325,11 +329,15 @@ export default class TcpSocket extends EventEmitter {
/**
* @private
- * @param {string} address
+ * @param {NativeConnectionInfo} connectionInfo
*/
- _setConnected(address) {
+ _setConnected(connectionInfo) {
this._state = STATE.CONNECTED;
- this._address = address;
+ this.localAddress = connectionInfo.localAddress;
+ this.localPort = connectionInfo.localPort;
+ this.remoteAddress = connectionInfo.remoteAddress;
+ this.remoteFamily = connectionInfo.remoteFamily;
+ this.remotePort = connectionInfo.remotePort;
}
/**
@@ -340,12 +348,4 @@ export default class TcpSocket extends EventEmitter {
this._unregisterEvents();
this._state = STATE.DISCONNECTED;
}
-
- ref() {
- console.warn('react-native-tcp-socket: TcpSocket.ref() method will have no effect.');
- }
-
- unref() {
- console.warn('react-native-tcp-socket: TcpSocket.unref() method will have no effect.');
- }
}
diff --git a/src/index.js b/src/index.js
index 6fbf5dd..17d1b34 100644
--- a/src/index.js
+++ b/src/index.js
@@ -22,7 +22,7 @@ class TCPSockets {
/**
* @param {import('./TcpSocket').ConnectionOptions} options
- * @param {(address: string) => void} callback
+ * @param {() => void} callback
* @returns {Socket}
*/
createConnection(options, callback) {
diff --git a/tsconfig.json b/tsconfig.json
index cc1c3cc..17258ab 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,7 +5,8 @@
"noEmit": true,
"strict": true,
"skipLibCheck": true,
- "typeRoots": ["@types/events"]
+ "esModuleInterop": true,
+ "typeRoots": ["@types/eventemitter3"]
},
"include": ["src", "lib"]
}
diff --git a/yarn.lock b/yarn.lock
index b86cb8f..ef6be2c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1421,7 +1421,7 @@
dependencies:
"@types/node" ">= 8"
-"@react-native-community/cli-platform-android@^2.0.1", "@react-native-community/cli-platform-android@^2.9.0":
+"@react-native-community/cli-platform-android@^2.6.0", "@react-native-community/cli-platform-android@^2.9.0":
version "2.9.0"
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-2.9.0.tgz#28831e61ce565a2c7d1905852fce1eecfd33cb5e"
integrity sha512-VEQs4Q6R5tnlYFrQIFoPEWjLc43whRHC9HeH+idbFymwDqysLVUffQbb9D6PJUj+C/AvrDhBhU6S3tDjGbSsag==
@@ -1434,7 +1434,7 @@
slash "^3.0.0"
xmldoc "^1.1.2"
-"@react-native-community/cli-platform-ios@^2.0.1", "@react-native-community/cli-platform-ios@^2.10.0":
+"@react-native-community/cli-platform-ios@^2.10.0", "@react-native-community/cli-platform-ios@^2.4.1":
version "2.10.0"
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-2.10.0.tgz#ee494d2f9a8f8727bd5eb3c446f22ebb5429b624"
integrity sha512-z5BQKyT/bgTSdHhvsFNf++6VP50vtOOaITnNKvw4954wURjv5JOQh1De3BngyaDOoGfV1mXkCxutqAXqSeuIjw==
@@ -1453,7 +1453,7 @@
mime "^2.4.1"
node-fetch "^2.5.0"
-"@react-native-community/cli@^2.0.1":
+"@react-native-community/cli@^2.6.0":
version "2.10.0"
resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-2.10.0.tgz#3bda7a77dadfde006d81ee835263b5ff88f1b590"
integrity sha512-KldnMwYzNJlbbJpJQ4AxwTMp89qqwilI1lEvCAwKmiviWuyYGACCQsXI7ikShRaQeakc28zyN2ldbkbrHeOoJA==
@@ -1666,10 +1666,12 @@
resolved "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
-"@types/events@^3.0.0":
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
- integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
+"@types/eventemitter3@^2.0.2":
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/@types/eventemitter3/-/eventemitter3-2.0.2.tgz#94b57c2568c4f09479d64812f625317b12a6edd0"
+ integrity sha1-lLV8JWjE8JR51kgS9iUxexKm7dA=
+ dependencies:
+ eventemitter3 "*"
"@types/graceful-fs@^4.1.2":
version "4.1.4"
@@ -3841,16 +3843,16 @@ event-target-shim@^5.0.0, event-target-shim@^5.0.1:
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
+eventemitter3@*, eventemitter3@^4.0.7:
+ version "4.0.7"
+ resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
+ integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
+
eventemitter3@^3.0.0:
version "3.1.2"
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==
-events@^3.1.0:
- version "3.1.0"
- resolved "https://registry.npmjs.org/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59"
- integrity sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==
-
exec-sh@^0.3.2:
version "0.3.4"
resolved "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5"
@@ -4636,6 +4638,11 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
+hermesvm@^0.1.0:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/hermesvm/-/hermesvm-0.1.1.tgz#bd1df92b4dc504e261c23df34864daf24b844d03"
+ integrity sha512-EosSDeUqTTGvlc9vQiy5Y/9GBlucEyo6lYuxg/FnukHCD/CP3NYeDAGV54TyZ19FgSqMEoPgOH9cyxvv8epQ1g==
+
hook-std@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz#ff9aafdebb6a989a354f729bb6445cf4a3a7077c"
@@ -6751,6 +6758,29 @@ metro-source-map@0.54.1:
"@babel/types" "^7.0.0"
source-map "^0.5.6"
+metro-source-map@0.55.0, metro-source-map@^0.55.0:
+ version "0.55.0"
+ resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.55.0.tgz#1f6289905f08277c398f2b9b9c13e7e0e5a6f540"
+ integrity sha512-HZODA0KPl5onJNGIztfTHHWurR2nL6Je/X8wwj+bL4ZBB/hSMVeDk7rWReCAvO3twVz7Ztp8Si0jfMmmH4Ruuw==
+ dependencies:
+ "@babel/traverse" "^7.0.0"
+ "@babel/types" "^7.0.0"
+ invariant "^2.2.4"
+ metro-symbolicate "0.55.0"
+ ob1 "0.55.0"
+ source-map "^0.5.6"
+ vlq "^1.0.0"
+
+metro-symbolicate@0.55.0:
+ version "0.55.0"
+ resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.55.0.tgz#4086a2adae54b5e44a4911ca572d8a7b03c71fa1"
+ integrity sha512-3r3Gpv5L4U7rBGpIqw5S1nun5MelfUMLRiScJsPRGZVTX3WY1w+zpaQKlWBi5yuHf5dMQ+ZUVbhb02IdrfJ2Fg==
+ dependencies:
+ metro-source-map "0.55.0"
+ source-map "^0.5.6"
+ through2 "^2.0.1"
+ vlq "^1.0.0"
+
metro@0.54.1, metro@^0.54.1:
version "0.54.1"
resolved "https://registry.yarnpkg.com/metro/-/metro-0.54.1.tgz#a629be00abee5a450a25a8f71c24745f70cc9b44"
@@ -7466,6 +7496,11 @@ oauth-sign@~0.9.0:
resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
+ob1@0.55.0:
+ version "0.55.0"
+ resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.55.0.tgz#e393b4ae786ef442b3ef2a298ab70d6ec353dbdd"
+ integrity sha512-pfyiMVsUItl8WiRKMT15eCi662pCRAuYTq2+V3UpE+PpFErJI/TvRh/M/l/9TaLlbFr7krJ7gdl+FXJNcybmvw==
+
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -8220,7 +8255,7 @@ react-deep-force-update@^1.0.0:
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.2.tgz#3d2ae45c2c9040cbb1772be52f8ea1ade6ca2ee1"
integrity sha512-WUSQJ4P/wWcusaH+zZmbECOk7H5N2pOIl0vzheeornkIMhu+qrNdGFm0bDZLCb0hSF0jf/kH1SgkNGfBdTc4wA==
-react-devtools-core@^3.6.0:
+react-devtools-core@^3.6.1:
version "3.6.3"
resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-3.6.3.tgz#977d95b684c6ad28205f0c62e1e12c5f16675814"
integrity sha512-+P+eFy/yo8Z/UH9J0DqHZuUM5+RI2wl249TNvMx3J2jpUomLQa4Zxl56GEotGfw3PIP1eI+hVf1s53FlUONStQ==
@@ -8238,15 +8273,15 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339"
integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==
-react-native@0.60.0:
- version "0.60.0"
- resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.60.0.tgz#f5302b6efe797c5f5fbdfebaba2ff174fc433890"
- integrity sha512-Leo1MfUpQFCLchr60HCDZAk7M6Bd2yPplSDBuCrC9gUtsRO2P4nLxwrX6P+vbjF7Td2sQbcGqW2E809Oi41K0g==
+react-native@0.60.5:
+ version "0.60.5"
+ resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.60.5.tgz#3c1d9c06a0fbab9807220b6acac09488d39186ee"
+ integrity sha512-cZwI0XzzihACN+7an1Dy46A83FRaAe2Xyd7laCalFFAppZIYeMVphZQWrVljJk5kIZBNtYG35TY1VsghQ0Oc2Q==
dependencies:
"@babel/runtime" "^7.0.0"
- "@react-native-community/cli" "^2.0.1"
- "@react-native-community/cli-platform-android" "^2.0.1"
- "@react-native-community/cli-platform-ios" "^2.0.1"
+ "@react-native-community/cli" "^2.6.0"
+ "@react-native-community/cli-platform-android" "^2.6.0"
+ "@react-native-community/cli-platform-ios" "^2.4.1"
abort-controller "^3.0.0"
art "^0.10.0"
base64-js "^1.1.2"
@@ -8256,15 +8291,17 @@ react-native@0.60.0:
event-target-shim "^5.0.1"
fbjs "^1.0.0"
fbjs-scripts "^1.1.0"
+ hermesvm "^0.1.0"
invariant "^2.2.4"
jsc-android "245459.0.0"
metro-babel-register "0.54.1"
metro-react-native-babel-transformer "0.54.1"
+ metro-source-map "^0.55.0"
nullthrows "^1.1.0"
pretty-format "^24.7.0"
promise "^7.1.1"
prop-types "^15.7.2"
- react-devtools-core "^3.6.0"
+ react-devtools-core "^3.6.1"
regenerator-runtime "^0.13.2"
scheduler "0.14.0"
stacktrace-parser "^0.1.3"
@@ -9646,7 +9683,7 @@ throat@^5.0.0:
resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b"
integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==
-through2@^2.0.0, through2@^2.0.2, through2@~2.0.0:
+through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@~2.0.0:
version "2.0.5"
resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==
@@ -10119,6 +10156,11 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
+vlq@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468"
+ integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==
+
w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"