Esempio n. 1
0
        public async Task SendGamepadStateAsync(GamepadState state)
        {
            var message = new GamepadMessage();

            message.State = state;

            await _transport.SendAsync(message);
        }
        public async Task SendMediaCommandStateAsync(MediaCommandState state)
        {
            var message = new MediaCommandMessage();

            message.State = state;

            await _transport.SendAsync(message);
        }
Esempio n. 3
0
        public async Task <AuxiliaryStreamClient> OpenAuxiliaryStreamAsync()
        {
            var auxiliaryStreamMessage = await _transport.WaitForMessageAsync <AuxiliaryStreamMessage>(
                TimeSpan.FromSeconds(1),
                () => _transport.SendAsync(new AuxiliaryStreamMessage()).Wait(),
                m => m.ConnectionInfo != null);

            var cryptoContext = new AuxiliaryStreamCryptoContext(
                auxiliaryStreamMessage.ConnectionInfo.CryptoKey,
                auxiliaryStreamMessage.ConnectionInfo.ServerInitVector,
                auxiliaryStreamMessage.ConnectionInfo.ClientInitVector,
                auxiliaryStreamMessage.ConnectionInfo.SignHash);

            var transport = new AuxiliaryStreamClient(
                auxiliaryStreamMessage.ConnectionInfo.Endpoints[0].Host,
                int.Parse(auxiliaryStreamMessage.ConnectionInfo.Endpoints[0].Service),
                cryptoContext);

            await transport.ConnectAsync();

            return(transport);
        }