function Connect()

in MiddlemanElectronSampleApp/Electron/renderer.js [41:72]


function Connect() {
    if (document.readyState === 'complete') {
        document.querySelector('#txtResults').value = "";
        if (appServiceConnection === null) {
            appServiceConnection = new AppServiceConnection();
        }
        appServiceConnection.appServiceName = "com.microsoft.datastreamerconnect";
        appServiceConnection.on("RequestReceived", requestReceivedHandler);
        appServiceConnection.on("ServiceClosed", serviceClosedHandler);

        // Running in a packaging project
         var pfn = Package.current.id.familyName;
        //var pfn = "27cd71fb-8fcd-4cbe-9019-f07ec581365d_n3sawgb4qe5x4";  // for debuging App Service by itself
        appServiceConnection.packageFamilyName = pfn;
        appServiceConnection.openAsync((error, result) => {
            if (error) {
                console.error(error);
                ReportResults("openAsync error: " + result);
                return;
            }

            if (result !== AppServiceConnectionStatus.success) {
                console.error("Failed to connect.");
                ReportResults("openAsync error: " + AppServiceConnectionStatusString(result));
                return;
            }
            ReportResults("openAsync: " + "AppServiceConnectionStatus.success");
            Send();
            AppServiceStatus();
        }) // openAync
    }
}