@vworlds/dgram-server 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,8 +11,14 @@ export declare class ServerSocket extends Socket {
|
|
|
11
11
|
constructor(connection: WebRTCConnection);
|
|
12
12
|
/** Connection id assigned by the server connection manager. */
|
|
13
13
|
get id(): string;
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Sends one binary payload to the connected browser peer.
|
|
16
|
+
*
|
|
17
|
+
* @returns A promise that rejects with `CONNECTION_CLOSED` when the data channel is not open, for
|
|
18
|
+
* example when the client disconnected mid-send. Callers must handle the rejection (`await` it or
|
|
19
|
+
* attach a `.catch()`); an ignored rejection is a fatal unhandled rejection in Node.
|
|
20
|
+
*/
|
|
21
|
+
send(data: Uint8Array): Promise<void>;
|
|
16
22
|
/** Closes the server-side data channel and peer connection. */
|
|
17
23
|
close(): void;
|
|
18
24
|
}
|
|
@@ -31,9 +31,15 @@ export class ServerSocket extends Socket {
|
|
|
31
31
|
get id() {
|
|
32
32
|
return this.connection.id;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Sends one binary payload to the connected browser peer.
|
|
36
|
+
*
|
|
37
|
+
* @returns A promise that rejects with `CONNECTION_CLOSED` when the data channel is not open, for
|
|
38
|
+
* example when the client disconnected mid-send. Callers must handle the rejection (`await` it or
|
|
39
|
+
* attach a `.catch()`); an ignored rejection is a fatal unhandled rejection in Node.
|
|
40
|
+
*/
|
|
35
41
|
send(data) {
|
|
36
|
-
this.connection.sendMessage(data);
|
|
42
|
+
return this.connection.sendMessage(data);
|
|
37
43
|
}
|
|
38
44
|
/** Closes the server-side data channel and peer connection. */
|
|
39
45
|
close() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-socket.js","sourceRoot":"","sources":["../../../../src/server/server-socket.ts"],"names":[],"mappings":"AACA,OA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|
|
1
1
|
{
|
|
2
2
|
"name": "@vworlds/dgram-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dgram-server/src/index.js",
|
|
6
6
|
"types": "./dgram-server/src/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "https://github.com/vworlds/dgram"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@vworlds/dgram-common": "1.0.
|
|
18
|
+
"@vworlds/dgram-common": "1.0.11",
|
|
19
19
|
"eventemitter3": "^5.0.4",
|
|
20
20
|
"express": "^4.18.2",
|
|
21
21
|
"node-datachannel": "^0.32.3"
|