Implementing Connection Reconnection Logic on Thinfinity VNC

Implementing Connection / Reconnection Logic (Disable Reconnection Warning)

This tutorial guides you through the process of implementing connection reconnection logic in your project. Follow the steps below to ensure a smoother experience for users during network instability by controlling display behavior and handling connection events efficiently.

Step 1: Adding disableDisplayWhileReconnecting Option

  1. Locate the vnc.js file within your project directory.
  2. Insert the following configuration option:
disableDisplayWhileReconnecting: true/false

This option dictates whether to display the interface during the reconnection process. Set it to true to activate this feature.

Step 2: Adding Connection Event Handlers

  1. In the customSettings.vnc.js file, search for the following code segment:
vnc.onConnectionLost = function (jData) {
    // -- TO CUSTOMIZE
    helper.console.log("onConnectionLost", arguments);
};

vnc.onConnectionRestored = function (jData) {
    // -- TO CUSTOMIZE
    helper.console.log("onConnectionRestored", arguments);
};

Tailor the logic within each event handler according to your project's needs. You might want to display a notification to the user or execute certain operations when the connection is lost or successfully restored.

Step 3: Modifying Logic with Event Subscription

To adjust the default behavior, follow these steps to subscribe to the events and implement your customized logic:

Add return true; within each event handler to ensure your custom logic is utilized:


vnc.onConnectionLost = function (jData) {
    // -- TO CUSTOMIZE
    helper.console.log("onConnectionLost", arguments);
    return true;
};

vnc.onConnectionRestored = function (jData) {
    // -- TO CUSTOMIZE
    helper.console.log("onConnectionRestored", arguments);
    return true;
};

  1. Ensure that return true; is included at the conclusion of each handler. This step is crucial for preventing the default handling mechanism or for the disableDisplayWhileReconnecting setting to be respected.

By carefully following these steps, you can effectively manage connection disruptions, providing a more resilient and user-friendly application environment.



    • Related Articles

    • How to Create your First RDP Connection using Thinfinity as a Jump Server

      1. Introduction Welcome to this comprehensive guide designed to facilitate the setup of your initial RDP connection using Thinfinity® Workspace. Within this guide, we'll provide a detailed walkthrough on configuring Thinfinity® as a jump server, ...
    • What's New on Thinfinity Remote Workspace 7

      Introduction Welcome to our comprehensive guide to the Thinfinity® Workspace 7. This article will introduce you to the product's groundbreaking features, new connection protocols, and enhanced user experience. Thinfinity® Workspace 7 is the epitome ...
    • How to Create your First RDP Connection Terminal Server (local Host)

      1. Introduction Welcome to this comprehensive guide, specifically designed to streamline the setup of your initial RDP connection using Thinfinity® Workspace. This tutorial focuses on creating an RDP connection on the same server where Thinfinity® ...
    • How to create an RDP connection using Agent mode in Thinfinity Workspace

      Introduction This document will guide you through the process of configuring an RDP connection using Agent mode. The Workspace Agent provides a convenient solution for establishing Remote Desktop Protocol (RDP) connections without opening inbound ...
    • How to Upgrade from Previous Versions

      Doc Type: How-to Product: Thinfinity Workspace Version: 7 and above This document will guide you through the process of upgrading to Thinfinity Workspace 7 from previous versions. Key Factors to Consider Before Upgrading Profiles and user ...