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); }
public void SendUdpTunnel(byte[] packet) { var message = new UdpTunnel { packet = packet }; MumbleWrite(message); }