Comparing version 0.1.2 to 0.1.3
@@ -46,3 +46,3 @@ /// <reference types="node" /> | ||
protected parser: MqttParser; | ||
protected connectTimer: object; | ||
protected connectTimer?: object; | ||
protected keepAliveTimer?: object; | ||
@@ -61,3 +61,3 @@ protected state: MqttClientState; | ||
listen<T>(listener: ListenOptions<T>): Observable<T>; | ||
protected startFlow<T>(flow: PacketFlowFunc<T>): Promise<T>; | ||
startFlow<T>(flow: PacketFlowFunc<T>): Promise<T>; | ||
/** | ||
@@ -74,2 +74,3 @@ * | ||
protected handlePacket(packet: MqttPacket): Promise<void>; | ||
protected reset(): void; | ||
protected setConnecting(): void; | ||
@@ -76,0 +77,0 @@ protected setConnected(): void; |
@@ -282,2 +282,9 @@ "use strict"; | ||
} | ||
reset() { | ||
this.connectTimer = undefined; | ||
this.keepAliveTimer = undefined; | ||
this.activeFlows = []; | ||
this.state.startResolve = undefined; | ||
this.parser.reset(); | ||
} | ||
setConnecting() { | ||
@@ -302,2 +309,3 @@ this.state.connecting = true; | ||
this.stopExecuting(this.keepAliveTimer); | ||
this.reset(); | ||
} | ||
@@ -304,0 +312,0 @@ } |
@@ -16,3 +16,4 @@ /// <reference types="node" /> | ||
constructor(errorCallback?: (e: Error) => void); | ||
reset(): void; | ||
parse(data: Buffer): Promise<MqttPacket[]>; | ||
} |
@@ -59,2 +59,7 @@ "use strict"; | ||
} | ||
reset() { | ||
this.stream = packet_stream_1.PacketStream.empty(); | ||
this.lock.locked = false; | ||
this.lock.resolve = null; | ||
} | ||
async parse(data) { | ||
@@ -61,0 +66,0 @@ await this.lock.wait(); |
{ | ||
"name": "mqtts", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "MQTT client in Typescript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122553
1959