/// <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); }); }
public async Task Connect(string ip, int port) { try { await client.ConnectAsync(ip, port); connected = true; ConnectDoneEvent?.Invoke(this); } catch (SocketException) { ConnectFailedEvent?.Invoke(this); } }
protected void onConnectFailed(VncCauseEventArgs a_args) { ConnectFailedEvent?.Invoke(this, a_args); }