예제 #1
0
 private void Connect()
 {
     using (Synchronizer.Lock(this)) {
         if (this.m_Sender == null)
         {
             try {
                 this.m_Sender   = new RTPMessageSender(this.m_IPEndPoint, this.m_Model, this.m_Classroom);
                 m_NetworkStatus = new NetworkStatus(ConnectionStatus.Connected, ConnectionProtocolType.RTP, TCPRole.None, 0);
                 if (m_AdvertisedClassroom)
                 {
                     m_NetworkStatus.ClassroomName = "Advertised Classroom (" + m_IPEndPoint.Address.ToString() + ")";
                 }
                 else
                 {
                     m_NetworkStatus.ClassroomName = m_ClassroomName;
                 }
                 m_Model.Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus);
             } catch (System.Net.Sockets.SocketException se) {
                 //TODO: We need to display a real message box here...
                 MessageBox.Show("Connection failed\n\rMachine must be connected to a network.\r\n"
                                 + "If you repeatedly encounter this error, you may need to restart your machine.\r\n"
                                 + "This is a known bug.  Thanks for your patience.");
                 Debug.WriteLine("Connection failed: " + se.ToString());
             } catch (Exception e) {
                 //TODO: We need to display a real message box here...
                 MessageBox.Show("Connection failed: " + e.ToString());
             }
         }
     }
 }
예제 #2
0
            public ParticipantManager(RTPMessageSender sender)
            {
                this.m_Sender = sender;

                this.m_Receivers    = new Hashtable();
                this.m_Participants = new Hashtable();

                RtpEvents.RtpStreamAdded   += new RtpEvents.RtpStreamAddedEventHandler(this.HandleStreamAdded);
                RtpEvents.RtpStreamRemoved += new RtpEvents.RtpStreamRemovedEventHandler(this.HandleStreamRemoved);
            }
예제 #3
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);
        }
예제 #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);
        }
예제 #5
0
        private void Disconnect()
        {
            RTPMessageSender sender = Interlocked.Exchange(ref this.m_Sender, null);

            if (sender != null)
            {
                m_Model.Network.RegisterNetworkStatusProvider(this, false, null);
                sender.Dispose();
            }

            // Clear out any presentations from the classroom
            using (Synchronizer.Lock(this.Classroom.SyncRoot)) {
                for (int i = this.Classroom.Presentations.Count - 1; i >= 0; i--)
                {
                    this.Classroom.Presentations.Remove(this.Classroom.Presentations[i]);
                }
            }
        }
예제 #6
0
 private void Connect()
 {
     using(Synchronizer.Lock(this)) {
         if(this.m_Sender == null) {
             try {
                 this.m_Sender = new RTPMessageSender(this.m_IPEndPoint, this.m_Model, this.m_Classroom);
                 m_NetworkStatus = new NetworkStatus(ConnectionStatus.Connected, ConnectionProtocolType.RTP, TCPRole.None, 0);
                 if (m_AdvertisedClassroom) {
                     m_NetworkStatus.ClassroomName = "Advertised Classroom (" + m_IPEndPoint.Address.ToString() + ")";
                 }
                 else {
                     m_NetworkStatus.ClassroomName = m_ClassroomName;
                 }
                 m_Model.Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus);
             } catch (System.Net.Sockets.SocketException se) {
                 //TODO: We need to display a real message box here...
                 MessageBox.Show("Connection failed\n\rMachine must be connected to a network.\r\n"
                     + "If you repeatedly encounter this error, you may need to restart your machine.\r\n"
                     + "This is a known bug.  Thanks for your patience.");
                 Debug.WriteLine("Connection failed: " + se.ToString());
             } catch (Exception e) {
                 //TODO: We need to display a real message box here...
                 MessageBox.Show("Connection failed: " + e.ToString());
             }
         }
     }
 }
예제 #7
0
            public ParticipantManager(RTPMessageSender sender)
            {
                this.m_Sender = sender;

                this.m_Receivers = new Hashtable();
                this.m_Participants = new Hashtable();

                RtpEvents.RtpStreamAdded += new RtpEvents.RtpStreamAddedEventHandler(this.HandleStreamAdded);
                RtpEvents.RtpStreamRemoved += new RtpEvents.RtpStreamRemovedEventHandler(this.HandleStreamRemoved);
            }