コード例 #1
0
        public NetworkPlayback(string filename)
        {
            ChunkAssembler assembler = new ChunkAssembler();
            NetworkArchiver archiver = new NetworkArchiver();
            archiver.OpenArchive(filename);

            while (archiver.HasMoreEvents()) {
                //Get the current event
                NetworkEvent ne = archiver.GetNextEvent();
                if (ne != null) {
                    //Add it to the chunkEvents (which contains everything)
                    this.chunkEvents.Add(ne);
                    if (ne is NetworkChunkEvent) {
                        NetworkChunkEvent nce = (NetworkChunkEvent)ne;
                        //Add it to the chunk assembler
                        Message m = assembler.Add(nce.chunk);
                        if (m != null) {
                            //We have a complete message!
                            NetworkMessageEvent nme = new NetworkMessageEvent(m, ne.timeIndex, ne.source);
                            this.messageEvents.Add(nme);
                        }
                    } else if (ne is NetworkMessageEvent) {
                        this.messageEvents.Add(((NetworkMessageEvent)ne).message);
                    } else {
                        //Skip
                    }
                }
            }
            archiver.CloseArchive();
        }
コード例 #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
        public CXPCapabilityMessageReceiver(CXPCapabilityMessageSender sender, uint ssrc, PresenterModel model, ClassroomModel classroom, ParticipantModel participant)
        {
            this.m_Model = model;
            this.m_Sender = sender;
            this.m_RemoteSSRC = ssrc;

            this.m_Context = new ReceiveContext(model, classroom, participant);
            this.m_ContextArgs = new object[] { this.m_Context };
            this.m_Queue = new MessageProcessingQueue(this);

            this.m_Assembler = new ChunkAssembler();
            this.m_Assembler.Nack += new ChunkAssembler.NackDelegate(this.HandleAssemblerNack);
        }
コード例 #4
0
        public RTPMessageReceiver(RTPMessageSender sender, RtpStream stream, PresenterModel model, ClassroomModel classroom, ParticipantModel participant)
        {
            this.m_Model = model;
            this.m_Sender = sender;
            this.m_RtpStream = stream;

            this.m_Context = new ReceiveContext(model, classroom, participant);
            this.m_ContextArgs = new object[] { this.m_Context };
            this.m_Queue = new MessageProcessingQueue(this);

            this.m_Serializer = new BinaryFormatter();

            this.m_Assembler = new ChunkAssembler();
            this.m_Assembler.Nack += new ChunkAssembler.NackDelegate(this.HandleAssemblerNack);

            this.m_RtpStream.FrameReceived += new RtpStream.FrameReceivedEventHandler(this.HandleFrameReceived);
        }