Initial connection handling

This commit is contained in:
Asher
2019-06-27 17:34:33 -05:00
parent 310bfe509e
commit 4861405683
6 changed files with 363 additions and 85 deletions

28
connection.ts Normal file
View File

@@ -0,0 +1,28 @@
import { Emitter } from "vs/base/common/event";
import { PersistentProtocol, ISocket } from "vs/base/parts/ipc/common/ipc.net";
import { VSBuffer } from "vs/base/common/buffer";
export abstract class Connection {
protected readonly _onClose = new Emitter<void>();
public readonly onClose = this._onClose.event;
public constructor(private readonly protocol: PersistentProtocol) {
this.protocol.onSocketClose(() => {
// TODO: eventually we'll want to clean up the connection if nothing
// ever connects back to it
});
}
public reconnect(socket: ISocket, buffer: VSBuffer): void {
this.protocol.beginAcceptReconnection(socket, buffer);
this.protocol.endAcceptReconnection();
}
}
export class ManagementConnection extends Connection {
// in here they accept the connection
// to the ipc of the RemoteServer
}
export class ExtensionHostConnection extends Connection {
}