Fix bugs
This commit is contained in:
parent
76db93d690
commit
d939e552f3
8 changed files with 47 additions and 39 deletions
|
|
@ -23,6 +23,14 @@ export default abstract class StreamManager<T extends Connection> extends EventE
|
|||
this.emit('disconnected');
|
||||
} else {
|
||||
this.emit('connected', this._connection);
|
||||
|
||||
this._connection.on('_connected_', () => {
|
||||
this.emit('_connected_');
|
||||
});
|
||||
|
||||
this._connection.on('_disconnected_', () => {
|
||||
this.emit('_disconnected_');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +45,11 @@ export default abstract class StreamManager<T extends Connection> extends EventE
|
|||
return this._connection != null;
|
||||
}
|
||||
|
||||
public get state(): string {
|
||||
if (!this.hasConnection) return 'no-connection';
|
||||
return this._connection.state;
|
||||
}
|
||||
|
||||
/**
|
||||
* コネクションを要求します
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue