From 84558f805ffbee76898a02dde1488a93679fa8ce Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 26 Nov 2018 18:54:26 -0600 Subject: [PATCH] Make sure to create UDP server outside GUI if first enabled after program launch More of an incremental change. Probably should remove async and await --- DS4Windows/DS4Forms/DS4Form.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 80f8149..c8791b7 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -2549,13 +2549,18 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question if (!state) { Program.rootHub.ChangeMotionEventStatus(state); - await TaskRunner.Delay(100); - Program.rootHub.ChangeUDPStatus(state); + await TaskRunner.Delay(100).ContinueWith((t) => + { + Program.rootHub.ChangeUDPStatus(state); + }); } else { Program.rootHub.ChangeUDPStatus(state); - Program.rootHub.ChangeMotionEventStatus(state); + await TaskRunner.Delay(100).ContinueWith((t) => + { + Program.rootHub.ChangeMotionEventStatus(state); + }); } nUDUdpPortNum.Enabled = state;