Exemplo n.º 1
0
 public void ReadInputsPipe()
 {
     while (_inputsPipe != null && _inputsPipe.IsConnected)
     {
         var msg = PipeHelper.ReadPipeData(_inputsPipe, "remotesession_" + _remotesessionID + "_inputs", false);
         if (msg != null && msg.Length > 0)
         {
             ProcessInputsPipeMessage(msg);
         }
     }
 }
Exemplo n.º 2
0
        private void ReadAudioPipe()
        {
            try
            {
                byte[] data;

                while (AudioPipe != null && AudioPipe.IsConnected)
                {
                    data = PipeHelper.ReadPipeData(AudioPipe, "remotesession_" + RemoteSession.Id + "_audio", false, audioBufferSize);
                    if (data != null && data.Length > 0)
                    {
                        RemoteSession.Manager.ProcessAudioPipeData(data);
                    }
                }
            }
            catch (Exception exc)
            {
                Trace.TraceError("Failed to read audio pipe, remote session {0} ({1})", RemoteSession.Id, exc);

                // there is a problem with the audio pipe, close the remote session in order to avoid it being stuck
                RemoteSession.Manager.SendCommand(RemoteSessionCommand.CloseClient);
            }
        }