2018-03-07 08:48:32 +00:00
|
|
|
import Stream from './stream';
|
|
|
|
import StreamManager from './stream-manager';
|
2018-03-15 10:53:46 +00:00
|
|
|
import MiOS from '../../mios';
|
2018-03-07 08:48:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Server stream connection
|
|
|
|
*/
|
|
|
|
export class ServerStream extends Stream {
|
2018-03-15 10:53:46 +00:00
|
|
|
constructor(os: MiOS) {
|
|
|
|
super(os, 'server');
|
2018-03-07 08:48:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ServerStreamManager extends StreamManager<ServerStream> {
|
2018-03-15 10:53:46 +00:00
|
|
|
private os: MiOS;
|
|
|
|
|
|
|
|
constructor(os: MiOS) {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.os = os;
|
|
|
|
}
|
|
|
|
|
2018-03-07 08:48:32 +00:00
|
|
|
public getConnection() {
|
|
|
|
if (this.connection == null) {
|
2018-03-15 10:53:46 +00:00
|
|
|
this.connection = new ServerStream(this.os);
|
2018-03-07 08:48:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return this.connection;
|
|
|
|
}
|
|
|
|
}
|