Skip to content

Commit 4c6d55e

Browse files
chore(release): 6.3.0 [skip ci]
# [6.3.0](v6.2.0...v6.3.0) (2025-04-23) ### Bug Fixes * Fix createServer() to properly handle Node.js-compatible options parameter ([#210](#210)) ([ace0e1c](ace0e1c)) * Upgrade bouncycastle dependency to 1.78.1 ([#205](#205)) ([f33522e](f33522e)) ### Features * **iOS:** Add more NodeJS TLS options ([#208](#208)) ([6d2fcae](6d2fcae)) * Added compatibility for concurrenct connections for Android 15 ([#206](#206)) ([4284f91](4284f91))
1 parent 3515e81 commit 4c6d55e

File tree

5 files changed

+68
-69
lines changed

5 files changed

+68
-69
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [6.3.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v6.2.0...v6.3.0) (2025-04-23)
2+
3+
4+
### Bug Fixes
5+
6+
* Fix createServer() to properly handle Node.js-compatible options parameter ([#210](https://github.com/Rapsssito/react-native-tcp-socket/issues/210)) ([ace0e1c](https://github.com/Rapsssito/react-native-tcp-socket/commit/ace0e1c072e4d5529815a6ba4dc4785240169e1f))
7+
* Upgrade bouncycastle dependency to 1.78.1 ([#205](https://github.com/Rapsssito/react-native-tcp-socket/issues/205)) ([f33522e](https://github.com/Rapsssito/react-native-tcp-socket/commit/f33522e9d4b0f50983551b9a399599bf849e4d05))
8+
9+
10+
### Features
11+
12+
* **iOS:** Add more NodeJS TLS options ([#208](https://github.com/Rapsssito/react-native-tcp-socket/issues/208)) ([6d2fcae](https://github.com/Rapsssito/react-native-tcp-socket/commit/6d2fcae65c27fb47953a04aa8a0b5f8bddc3b7a7))
13+
* Added compatibility for concurrenct connections for Android 15 ([#206](https://github.com/Rapsssito/react-native-tcp-socket/issues/206)) ([4284f91](https://github.com/Rapsssito/react-native-tcp-socket/commit/4284f91e23f621b8767ec2cf3d31e434aa26bd5a))
14+
115
# [6.2.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v6.1.0...v6.2.0) (2024-07-08)
216

317

coverage/coverage-final.json

+5-5
Large diffs are not rendered by default.

lib/types/Server.d.ts

+29-39
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @property {number} [keepAliveInitialDelay]
66
* @property {boolean} [allowHalfOpen]
77
* @property {boolean} [pauseOnConnect]
8-
*
8+
*
99
* @typedef {import('./TLSSocket').default} TLSSocket
1010
*
1111
* @typedef {object} ServerEvents
@@ -22,24 +22,22 @@ export default class Server extends EventEmitter<ServerEvents, any> {
2222
* @param {ServerOptions | ((socket: Socket) => void)} [options] Server options or connection listener
2323
* @param {(socket: Socket) => void} [connectionCallback] Automatically set as a listener for the `'connection'` event.
2424
*/
25-
constructor(options?: ServerOptions | ((socket: Socket) => void), connectionCallback?: (socket: Socket) => void);
26-
25+
constructor(options?: ServerOptions | ((socket: Socket) => void) | undefined, connectionCallback?: ((socket: Socket) => void) | undefined);
2726
/** @protected @readonly */
2827
protected readonly _id: number;
2928
/** @protected @readonly */
3029
protected readonly _eventEmitter: import("react-native").EventEmitter;
3130
/** @private @type {Set<Socket>} */
32-
private _connections: Set<Socket>;
33-
/** @private */
34-
private _localAddress: string | undefined;
31+
private _connections;
3532
/** @private */
36-
private _localPort: number | undefined;
33+
private _localAddress;
3734
/** @private */
38-
private _localFamily: string | undefined;
35+
private _localPort;
3936
/** @private */
40-
private _serverOptions: ServerOptions;
37+
private _localFamily;
38+
/** @private @type {ServerOptions} */
39+
private _serverOptions;
4140
listening: boolean;
42-
4341
/**
4442
* Start a server listening for connections.
4543
*
@@ -50,15 +48,16 @@ export default class Server extends EventEmitter<ServerEvents, any> {
5048
* `server.listen()` call or `server.close()` has been called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN`
5149
* error will be thrown.
5250
*
53-
* @param {{ port: number; host?: string; reuseAddress?: boolean} | number} options
54-
* @param {string | (() => void)} [callback_or_host]
55-
* @param {() => void} [callback]
51+
* @param {{ port: number; host?: string; reuseAddress?: boolean} | number} options Options or port
52+
* @param {string | (() => void)} [callback_or_host] Callback or host string
53+
* @param {() => void} [callback] Callback function
5654
* @returns {Server}
5755
*/
58-
listen(options: { port: number; host?: string; reuseAddress?: boolean } | number,
59-
callback_or_host?: string | (() => void),
60-
callback?: () => void): Server;
61-
56+
listen(options: {
57+
port: number;
58+
host?: string;
59+
reuseAddress?: boolean;
60+
} | number, callback_or_host?: string | (() => void) | undefined, callback?: (() => void) | undefined): Server;
6261
/**
6362
* Asynchronously get the number of concurrent connections on the server.
6463
*
@@ -68,7 +67,6 @@ export default class Server extends EventEmitter<ServerEvents, any> {
6867
* @returns {Server}
6968
*/
7069
getConnections(callback: (err: Error | null, count: number) => void): Server;
71-
7270
/**
7371
* Stops the server from accepting new connections and keeps existing connections.
7472
* This function is asynchronous, the server is finally closed when all connections are ended and the server emits a `'close'` event.
@@ -78,8 +76,7 @@ export default class Server extends EventEmitter<ServerEvents, any> {
7876
* @param {(err?: Error) => void} [callback] Called when the server is closed.
7977
* @returns {Server}
8078
*/
81-
close(callback?: (err?: Error) => void): Server;
82-
79+
close(callback?: ((err?: Error | undefined) => void) | undefined): Server;
8380
/**
8481
* Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening
8582
* on an IP socket (useful to find which port was assigned when getting an OS-assigned address):
@@ -88,26 +85,24 @@ export default class Server extends EventEmitter<ServerEvents, any> {
8885
* @returns {import('./Socket').AddressInfo | null}
8986
*/
9087
address(): import('./Socket').AddressInfo | null;
91-
9288
ref(): Server;
9389
unref(): Server;
94-
9590
/**
9691
* @private
9792
*/
98-
private _registerEvents(): void;
99-
93+
private _registerEvents;
94+
_listeningListener: import("react-native").EmitterSubscription | undefined;
95+
_errorListener: import("react-native").EmitterSubscription | undefined;
96+
_connectionsListener: import("react-native").EmitterSubscription | undefined;
10097
/**
10198
* @private
10299
*/
103-
private _setDisconnected(): void;
104-
100+
private _setDisconnected;
105101
/**
106102
* @protected
107103
* @param {Socket} socket
108104
*/
109105
protected _addConnection(socket: Socket): void;
110-
111106
/**
112107
* @protected
113108
* @param {{ id: number; connection: import('./Socket').NativeConnectionInfo; }} info
@@ -117,32 +112,27 @@ export default class Server extends EventEmitter<ServerEvents, any> {
117112
id: number;
118113
connection: import('./Socket').NativeConnectionInfo;
119114
}): Socket;
120-
121115
/**
122116
* Apply server socket options to a newly connected socket
123117
* @param {Socket} socket
124118
* @private
125119
*/
126-
private _applySocketOptions(socket: Socket): void;
120+
private _applySocketOptions;
127121
}
128-
129122
export type ServerOptions = {
130-
noDelay?: boolean;
131-
keepAlive?: boolean;
132-
keepAliveInitialDelay?: number;
133-
allowHalfOpen?: boolean;
134-
pauseOnConnect?: boolean;
123+
noDelay?: boolean | undefined;
124+
keepAlive?: boolean | undefined;
125+
keepAliveInitialDelay?: number | undefined;
126+
allowHalfOpen?: boolean | undefined;
127+
pauseOnConnect?: boolean | undefined;
135128
};
136-
137129
export type TLSSocket = import("./TLSSocket").default;
138-
139130
export type ServerEvents = {
140131
close: () => void;
141132
connection: (socket: Socket) => void;
142133
listening: () => void;
143134
error: (err: Error) => void;
144135
secureConnection: (tlsSocket: TLSSocket) => void;
145136
};
146-
147137
import EventEmitter from "eventemitter3";
148-
import Socket from "./Socket";
138+
import Socket from "./Socket";

lib/types/index.d.ts

+19-24
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ declare namespace _default {
1414
export const hasIdentity: typeof import("./TLSSocket").default.hasIdentity;
1515
}
1616
export default _default;
17+
export type ServerOptions = {
18+
noDelay?: boolean | undefined;
19+
keepAlive?: boolean | undefined;
20+
keepAliveInitialDelay?: number | undefined;
21+
allowHalfOpen?: boolean | undefined;
22+
pauseOnConnect?: boolean | undefined;
23+
};
1724
/**
1825
* @param {import('./Socket').ConnectionOptions} options
1926
* @param {() => void} callback
2027
* @returns {Socket}
2128
*/
22-
declare function createConnection(
23-
options: import('./Socket').ConnectionOptions,
24-
callback: () => void
25-
): Socket;
29+
declare function createConnection(options: import('./Socket').ConnectionOptions, callback: () => void): Socket;
2630
/**
2731
* @typedef {object} ServerOptions
2832
* @property {boolean} [noDelay]
@@ -31,37 +35,28 @@ declare function createConnection(
3135
* @property {boolean} [allowHalfOpen]
3236
* @property {boolean} [pauseOnConnect]
3337
*/
34-
3538
/**
36-
* @param {ServerOptions | ((socket: Socket) => void)} [options]
37-
* @param {(socket: Socket) => void} [connectionListener]
39+
* Creates a new TCP server.
40+
*
41+
* @param {ServerOptions | ((socket: Socket) => void)} [options] An options object or a connection listener
42+
* @param {(socket: Socket) => void} [connectionListener] A listener for the 'connection' event
3843
* @returns {Server}
3944
*/
40-
declare function createServer(
41-
options?: object | ((socket: Socket) => void),
42-
connectionListener?: (socket: Socket) => void
43-
): Server;
44-
45+
declare function createServer(options?: ServerOptions | ((socket: Socket) => void) | undefined, connectionListener?: ((socket: Socket) => void) | undefined): Server;
4546
/**
4647
* @param {import('./TLSServer').TLSServerOptions} options
4748
* @param {(socket: TLSSocket) => void} connectionListener
4849
* @returns {TLSServer}
4950
*/
50-
declare function createTLSServer(
51-
options: import('./TLSServer').TLSServerOptions,
52-
connectionListener: (socket: TLSSocket) => void
53-
): TLSServer;
51+
declare function createTLSServer(options: import('./TLSServer').TLSServerOptions, connectionListener: (socket: TLSSocket) => void): TLSServer;
5452
/**
5553
* The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event.
5654
*
5755
* @param {import('./TLSSocket').TLSSocketOptions & import('./Socket').ConnectionOptions} options
5856
* @param {() => void} [callback]
5957
* @returns {TLSSocket}
6058
*/
61-
declare function connectTLS(
62-
options: import('./TLSSocket').TLSSocketOptions & import('./Socket').ConnectionOptions,
63-
callback?: (() => void) | undefined
64-
): TLSSocket;
59+
declare function connectTLS(options: import('./TLSSocket').TLSSocketOptions & import('./Socket').ConnectionOptions, callback?: (() => void) | undefined): TLSSocket;
6560
/**
6661
* Tests if input is an IP address. Returns `0` for invalid strings, returns `4` for IP version 4 addresses, and returns `6` for IP version 6 addresses.
6762
*
@@ -80,7 +75,7 @@ declare function isIPv4(input: string): boolean;
8075
* @param {string} input
8176
*/
8277
declare function isIPv6(input: string): boolean;
83-
import Server from './Server';
84-
import Socket from './Socket';
85-
import TLSServer from './TLSServer';
86-
import TLSSocket from './TLSSocket';
78+
import Server from "./Server";
79+
import Socket from "./Socket";
80+
import TLSServer from "./TLSServer";
81+
import TLSSocket from "./TLSSocket";

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-tcp-socket",
33
"title": "React Native Tcp Socket",
4-
"version": "6.2.0",
4+
"version": "6.3.0",
55
"description": "React Native TCP socket API for Android & iOS with SSL/TLS support",
66
"main": "src/index.js",
77
"types": "lib/types/index.d.ts",

0 commit comments

Comments
 (0)