private static async Task StartScreenCasting() { CursorIconWatcher = Services.GetRequiredService <ICursorIconWatcher>(); await CasterSocket.Connect(Conductor.Host); await CasterSocket.SendDeviceInfo(Conductor.ServiceID, Environment.MachineName, Conductor.DeviceID); if (Win32Interop.GetCurrentDesktop(out var currentDesktopName)) { Logger.Write($"Setting initial desktop to {currentDesktopName}."); } else { Logger.Write("Failed to get initial desktop name."); } if (!Win32Interop.SwitchToInputDesktop()) { Logger.Write("Failed to set initial desktop."); } await SendReadyNotificationToViewers(); Services.GetRequiredService <IdleTimer>().Start(); CursorIconWatcher.OnChange += CursorIconWatcher_OnChange; Services.GetRequiredService <IClipboardService>().BeginWatching(); Services.GetRequiredService <IKeyboardMouseInput>().Init(); }
public async Task Connect() { await CasterSocket.Connect(Host); }