2022-07-31 19:53:15 +02:00
|
|
|
import { Settings } from "../Settings/Settings";
|
2022-07-30 16:19:22 +02:00
|
|
|
import { Remote } from "./Remote";
|
|
|
|
|
|
|
|
|
2022-07-31 19:53:15 +02:00
|
|
|
let server: Remote;
|
2022-07-30 16:19:22 +02:00
|
|
|
|
2022-07-31 19:53:15 +02:00
|
|
|
export function newRemoteFileApiConnection() : void {
|
|
|
|
if(server == undefined)
|
|
|
|
server = new Remote("localhost", Settings.RemoteFileApiPort);
|
|
|
|
else {
|
|
|
|
server.stopConnection();
|
|
|
|
server = new Remote("localhost", Settings.RemoteFileApiPort);
|
|
|
|
server.startConnection();
|
2022-07-30 16:19:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-31 19:53:15 +02:00
|
|
|
export function isRemoteFileApiConnectionLive() : boolean {
|
|
|
|
return server.connection != undefined && server.connection.readyState == 1;
|
|
|
|
}
|