Пример #1
0
 public UdpSocket(IPEndPoint host, IMumbleProtocol protocol, MumbleConnection connection)
 {
     _host       = host;
     _protocol   = protocol;
     _connection = connection;
     _client     = new UdpClient();
 }
Пример #2
0
        /// <summary>
        /// Associates this protocol with an opening mumble connection
        /// </summary>
        /// <param name="connection"></param>
        public virtual void Initialise(MumbleConnection connection)
        {
            Connection = connection;

            _encodingThread = new Thread(EncodingThreadEntry)
            {
                IsBackground = true
            };
        }
        /// <summary>
        /// Associates this protocol with an opening mumble connection
        /// </summary>
        /// <param name="connection"></param>
        public virtual void Initialise(MumbleConnection connection)
        {
            Connection = connection;

            //Start the EncodingThreadEntry thread, and collect a possible exception at termination
            _encodingThreadStart  = new ThreadStart(() => EncodingThreadEntry(out _encodingThreadException));
            _encodingThreadStart += () => {
                if (_encodingThreadException != null)
                {
                    throw new Exception($"{nameof(BasicMumbleProtocol)}'s {nameof(_encodingThread)} was terminated unexpectedly because of a {_encodingThreadException.GetType().ToString()}", _encodingThreadException);
                }
            };

            _encodingThread = new Thread(_encodingThreadStart)
            {
                IsBackground = true,
                Priority     = ThreadPriority.AboveNormal
            };
        }
Пример #4
0
 /// <summary>
 /// Associates this protocol with an opening mumble connection
 /// </summary>
 /// <param name="connection"></param>
 public virtual void Initialise(MumbleConnection connection)
 {
     Connection = connection;
 }