Exemplo n.º 1
0
        /// <summary>
        /// Callback method for when the client connection fails.
        /// </summary>
        /// <param name="result">The connection failed result.</param>
        private void OnConnectFailed(ConnectFailedResult result)
        {
            Logger.Get().Info(this, $"Connection to server failed, cause: {result.Type}");

            UpdateManager?.StopUdpUpdates();

            IsConnected = false;

            // Invoke callback if it exists on the main thread of Unity
            ThreadUtil.RunActionOnMainThread(() => {
                ConnectFailedEvent?.Invoke(result);
            });
        }
Exemplo n.º 2
0
        public async Task Connect(string ip, int port)
        {
            try
            {
                await client.ConnectAsync(ip, port);

                connected = true;
                ConnectDoneEvent?.Invoke(this);
            }
            catch (SocketException)
            {
                ConnectFailedEvent?.Invoke(this);
            }
        }
Exemplo n.º 3
0
 protected void onConnectFailed(VncCauseEventArgs a_args)
 {
     ConnectFailedEvent?.Invoke(this, a_args);
 }