xbox-smartglass-csharp icon indicating copy to clipboard operation
xbox-smartglass-csharp copied to clipboard

SendGamepadStateAsync takes 2 minutes to send?

Open nathenxbrewer opened this issue 1 year ago • 1 comments

I'm trying to send buttons to my Xbox but it's taking about 2 minutes for the Xbox to respond. During this time, the ConnectAsync method throws a TimeoutException. I've tried 3 different Xbox One's in my house with the same result. Am I doing something wrong?

static async Task SendGamepadStateAsync(SmartGlassClient sgCLient, GamepadState pState)
    {
        pState.Timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
        await sgCLient.InputChannel.SendGamepadStateAsync(pState);
        pState.Buttons = GamepadButtons.Clear;
        pState.Timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
        await sgCLient.InputChannel.SendGamepadStateAsync(pState);
    }`

nathenxbrewer avatar Aug 29 '24 13:08 nathenxbrewer

A bit more info:

https://github.com/OpenXbox/xbox-smartglass-csharp/issues/115

I see now that the console app is doing something similar. Apparently my ConnectAsync Task is not actually being awaited like I thought. So what seems to be happening is that it's taking ~2 mins for the ConnectAsync to finish, then the console will send the Gamepad state.

I'd still like to find out why it takes 2 mins for a connection to be made.

nathenxbrewer avatar Aug 29 '24 13:08 nathenxbrewer