Skip to content

Commit 16fea0b

Browse files
committed
fix: Remove timeout from connection parameters
1 parent 5473481 commit 16fea0b

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ Here are listed all methods implemented in `react-native-tcp-socket` that imitat
368368
| -------------- | ----------- | :-------: | :-----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
369369
| **`port`** | `<number>` ||| **Required**. Port the socket should connect to. |
370370
| `host` | `<string>` ||| Host the socket should connect to. IP address in IPv4 format or `'localhost'`. **Default**: `'localhost'`. |
371-
| `timeout` | `<number>` ||| If set, will be used to call [`setTimeout(timeout)`](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the socket is created, but before it starts the connection. |
372371
| `localAddress` | `<string>` ||| Local address the socket should connect from. If not specified, the OS will decide. It is **highly recommended** to specify a `localAddress` to prevent overload errors and improve performance. |
373372
| `localPort` | `<number>` ||| Local port the socket should connect from. If not specified, the OS will decide. |
374373
| `interface` | `<string>` ||| Interface the socket should connect from. If not specified, it will use the current active connection. The options are: `'wifi', 'ethernet', 'cellular'`. |

src/Socket.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { nativeEventEmitter, getNextId } from './Globals';
1818
* @typedef {{
1919
* port: number;
2020
* host?: string;
21-
* timeout?: number,
2221
* localAddress?: string,
2322
* localPort?: number,
2423
* interface?: 'wifi' | 'cellular' | 'ethernet',
@@ -163,9 +162,6 @@ export default class Socket extends EventEmitter {
163162
this.once('connect', () => {
164163
if (callback) callback();
165164
});
166-
// Timeout
167-
if (customOptions.timeout) this.setTimeout(customOptions.timeout);
168-
else if (this._timeout) this._activateTimer();
169165
this._connecting = true;
170166
this._readyState = 'opening';
171167
Sockets.connect(this._id, customOptions.host, customOptions.port, customOptions);

0 commit comments

Comments
 (0)