예제 #1
0
        public TCPMessageReceiver(ITCPReceiver receiver, PresenterModel model, ClassroomModel classroom)
        {
            this.m_Model = model;
            this.m_Classroom = classroom;
            this.m_Receiver = receiver;
            this.m_Assembler = new ChunkAssembler();

            #if RTP_BUILD
            //If we are in the public role and the receiver enabled the client-side bridge, start the bridge.
            bool isPublicRole = false;
            using (Synchronizer.Lock(m_Model.SyncRoot)) {
                using (Synchronizer.Lock(m_Model.Participant.SyncRoot)) {
                    if (m_Model.Participant.Role is PublicModel) {
                        isPublicRole = true;
                    }
                }
            }
            if ((isPublicRole) && (receiver is TCPClient) && ((TCPClient)receiver).BridgeEnabled) {
                m_U2MBridge = new ClientUnicastToMulticastBridge(m_Model);
            }
            #endif
            this.m_Queue = new MessageProcessingQueue(this);

            Thread thread = new Thread(new ThreadStart(this.ReceiveThread));
            thread.Name = "TCPMessageReceiver";
            thread.Start();
        }
예제 #2
0
        public TCPMessageReceiver(ITCPReceiver receiver, PresenterModel model, ClassroomModel classroom)
        {
            this.m_Model     = model;
            this.m_Classroom = classroom;
            this.m_Receiver  = receiver;
            this.m_Assembler = new ChunkAssembler();

#if RTP_BUILD
            //If we are in the public role and the receiver enabled the client-side bridge, start the bridge.
            bool isPublicRole = false;
            using (Synchronizer.Lock(m_Model.SyncRoot)) {
                using (Synchronizer.Lock(m_Model.Participant.SyncRoot)) {
                    if (m_Model.Participant.Role is PublicModel)
                    {
                        isPublicRole = true;
                    }
                }
            }
            if ((isPublicRole) && (receiver is TCPClient) && ((TCPClient)receiver).BridgeEnabled)
            {
                m_U2MBridge = new ClientUnicastToMulticastBridge(m_Model);
            }
#endif
            this.m_Queue = new MessageProcessingQueue(this);


            Thread thread = new Thread(new ThreadStart(this.ReceiveThread));
            thread.Name = "TCPMessageReceiver";
            thread.Start();
        }
예제 #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (this.m_Disposed)
            {
                return;
            }
            if (disposing)
            {
#if RTP_BUILD
                if (m_U2MBridge != null)
                {
                    this.m_U2MBridge.Dispose(true);
                    this.m_U2MBridge = null;
                }
#endif
                this.m_Queue.Dispose();
            }
            this.m_Disposed = true;
        }
예제 #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (this.m_Disposed) return;
     if (disposing) {
     #if RTP_BUILD
         if (m_U2MBridge != null) {
             this.m_U2MBridge.Dispose(true);
             this.m_U2MBridge = null;
         }
     #endif
         this.m_Queue.Dispose();
     }
     this.m_Disposed = true;
 }