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
This commit is contained in:
Travis Nickles 2018-11-26 18:54:26 -06:00
parent 532444de48
commit 84558f805f

View File

@ -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;