Exemplo n.º 1
0
        private IExtensible MumbleRead()
        {
            var sslStreamReader = new BinaryReader(_sslStream);

            IExtensible result;

            try
            {
                Int16 type = IPAddress.NetworkToHostOrder(sslStreamReader.ReadInt16());
                Int32 size = IPAddress.NetworkToHostOrder(sslStreamReader.ReadInt32());

                if (type == (int)MessageTypes.UdpTunnel)
                {
                    result = new UdpTunnel {
                        packet = sslStreamReader.ReadBytes(size)
                    };
                }
                else
                {
                    result = MumbleProtocolFactory.Deserialize((MessageTypes)type, size, sslStreamReader);
                }
            }
            catch (IOException)
            {
                result = null;
            }
            return(result);
        }
Exemplo n.º 2
0
        public void SendUdpTunnel(byte[] packet)
        {
            var message = new UdpTunnel {
                packet = packet
            };


            MumbleWrite(message);
        }