mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
deferredConnection for reconnecter.
This commit is contained in:
parent
78cefb95b7
commit
efe04c62ed
@ -119,14 +119,17 @@ export class Reconnecter extends EventEmitter<ReconnecterEvents> {
|
||||
}
|
||||
}
|
||||
|
||||
public open(): void {
|
||||
public open(deferredConnection = false): void {
|
||||
if (this._open) {
|
||||
throw new Error('connection is already open')
|
||||
}
|
||||
|
||||
this._open = true
|
||||
this.emit('open')
|
||||
this.connect()
|
||||
|
||||
if (!deferredConnection) {
|
||||
this.connect()
|
||||
}
|
||||
}
|
||||
|
||||
public close(error?: Error): void {
|
||||
|
Loading…
Reference in New Issue
Block a user