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