@geckos.io/client
Advanced tools
Comparing version 1.4.3 to 1.5.0
import { RawMessage, Data, EventName, EventCallbackClient, ConnectionEventCallbackClient, EventCallbackRawMessage, ClientOptions, EmitOptions } from '@geckos.io/common/lib/typings'; | ||
export declare class ClientChannel { | ||
maxMessageSize: number | undefined; | ||
private peerConnection; | ||
@@ -4,0 +5,0 @@ private connectionsManager; |
@@ -139,6 +139,7 @@ "use strict"; | ||
ClientChannel.prototype.onConnect = function (callback) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var error; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
@@ -152,7 +153,11 @@ // TODO(yandeu) add a connection timeout (or something like this) | ||
case 1: | ||
error = _a.sent(); | ||
error = _b.sent(); | ||
if (error) | ||
callback(error); | ||
else | ||
else { | ||
// keep track of the maxMessageSize | ||
this.maxMessageSize = this.connectionsManager.maxMessageSize = (_a = this.peerConnection.localPeerConnection.sctp) === null || _a === void 0 ? void 0 : _a.maxMessageSize; | ||
// init onConnectionStateChange event | ||
this.onconnectionstatechange(); | ||
} | ||
return [2 /*return*/]; | ||
@@ -159,0 +164,0 @@ } |
import client, { ClientChannel } from './client'; | ||
import { Data, RawMessage, ChannelId } from '@geckos.io/common/lib/typings'; | ||
export default client; | ||
export { ClientChannel, Data, RawMessage, ChannelId }; | ||
export type { ClientChannel, Data, RawMessage, ChannelId }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -22,6 +22,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ClientChannel = void 0; | ||
var client_1 = __importStar(require("./client")); | ||
Object.defineProperty(exports, "ClientChannel", { enumerable: true, get: function () { return client_1.ClientChannel; } }); | ||
exports.default = client_1.default; | ||
//# sourceMappingURL=index.js.map |
@@ -11,2 +11,3 @@ import { Bridge } from '@geckos.io/common/lib/bridge'; | ||
rtcConfiguration: RTCConfiguration; | ||
maxMessageSize: number | undefined; | ||
localPeerConnection: RTCPeerConnection; | ||
@@ -13,0 +14,0 @@ remotePeerConnection: RTCRemotePeerConnection; |
@@ -81,3 +81,3 @@ "use strict"; | ||
if (data === void 0) { data = null; } | ||
sendMessage_1.default(this.dataChannel, eventName, data); | ||
sendMessage_1.default(this.dataChannel, this.maxMessageSize, eventName, data); | ||
}; | ||
@@ -84,0 +84,0 @@ // fetch additional candidates |
{ | ||
"name": "@geckos.io/client", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"description": "Real-time client/server communication over UDP using WebRTC and Node.js", | ||
@@ -47,4 +47,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@geckos.io/common": "^1.4.3" | ||
"@geckos.io/common": "^1.5.0" | ||
}, | ||
"funding": { | ||
"url": "https://github.com/sponsors/yandeu" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47546
642
Updated@geckos.io/common@^1.5.0