public TCPClient(IPEndPoint remoteEP, ParticipantModel participant, NetworkModel network, Guid serverID) { m_Connected = false; m_Network = network; m_Participant = participant; m_LastMsgReceived = DateTime.MaxValue; m_ServerId = serverID; m_ClientTimeout = TimeSpan.FromMilliseconds(TCP_HEARTBEAT_TIMEOUT_DEFAULT_MS); this.m_RemoteEP = remoteEP; m_Socket = null; m_ServerParticipant = null; m_ReceiveQueue = new Queue(); this.m_Encoder = new Chunk.ChunkEncoder(); m_NetworkStatus = new NetworkStatus(ConnectionStatus.Disconnected, ConnectionProtocolType.TCP, TCPRole.Client, 0); this.m_Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus); //Find out if client-side bridging is enabled m_BridgeEnabled = false; string enableBridge = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".EnableBridge"]; if (enableBridge != null) { bool enable = false; if (bool.TryParse(enableBridge, out enable)) { Trace.WriteLine("Unicast to Multicast Bridge enabled=" + enable.ToString(), this.GetType().ToString()); m_BridgeEnabled = enable; } } }
public PresenterModel() { this.m_Stylus = null; this.m_CurrentResult = null; this.m_Network = new NetworkModel(); this.m_VersionExchange = new VersionExchangeModel(); /// Note: We currently assume that the ParticipantModel Guid will be different for each application invocation. /// (In particular TCP reconnection relies on this assumption.) If we need an identifer that persists across /// sessions, we'd need to create a new identifier for this. ParticipantId = Guid.NewGuid(); this.m_Participant = new ParticipantModel(ParticipantId, System.Windows.Forms.SystemInformation.UserName); this.m_Workspace = new WorkspaceModel(); this.m_Undo = new UndoModel(); this.m_ViewerState = new ViewerStateModel(); this.m_PenState = new PenStateModel(); TheInstance = this; }
public ProtocolCollectionHelper(ManualConnectionMenu parent, PresentationsMenu presMenu, NetworkModel network) : base(parent.m_EventQueue, network, "Protocols") { this.m_Parent = parent; this.m_PresentationsMenu = presMenu; base.Initialize(); }
public ProtocolCollectionHelper(PresentationsPanel parent, NetworkModel network) : base(parent.m_EventQueue, network, "Protocols") { this.m_Parent = parent; base.Initialize(); }
public ProtocolCollectionHelper(ConnectTCPMenuItem parent, NetworkModel network) : base(parent.m_EventQueue, network, "Protocols") { this.m_Parent = parent; base.Initialize(); }
public TCPServer(IPEndPoint localEP, PresenterModel model, ClassroomModel classroom, InstructorModel instructor) { RestoreConfig(); m_ClientConnected = new ManualResetEvent(false); m_Participant = model.Participant; m_Classroom = classroom; m_ClientCount = 0; this.m_Network = model.Network; m_NetworkStatus = new NetworkStatus(ConnectionStatus.Disconnected, ConnectionProtocolType.TCP, TCPRole.Server, 0); this.m_Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus); if (localEP != null) { this.m_ListenEP = localEP; } else { this.m_ListenEP = new IPEndPoint(IPAddress.Any, DefaultPort); } m_AllClients = new Hashtable(); m_ReceiveQueue = new Queue(); this.m_Encoder = new Chunk.ChunkEncoder(); this.m_ServerSender = new TCPServerSender(instructor); //Start bridging if config file says so #if RTP_BUILD m_U2MBridge = null; string enableBridge = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".EnableBridge"]; if (enableBridge != null) { bool enable = false; if (bool.TryParse(enableBridge, out enable) && enable) { Trace.WriteLine("Unicast to Multicast Bridge enabled.", this.GetType().ToString()); m_U2MBridge = new UnicastToMulticastBridge(model); } } #endif }
public TCPServer(IPEndPoint localEP, PresenterModel model, ClassroomModel classroom, InstructorModel instructor) { string portStr = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".TCPListenPort"]; int p; if (Int32.TryParse(portStr, out p)) { TCPListenPort = p; } RestoreConfig(); m_ClientConnected = new ManualResetEvent(false); m_Participant = model.Participant; m_Classroom = classroom; m_ClientCount = 0; this.m_Network = model.Network; m_NetworkStatus = new NetworkStatus(ConnectionStatus.Disconnected, ConnectionProtocolType.TCP, TCPRole.Server, 0); this.m_Network.RegisterNetworkStatusProvider(this, true, m_NetworkStatus); if (localEP != null) { this.m_ListenEP = localEP; } else { IPAddress ip = IPAddress.Any; //Use IPv4 unless it is unavailable. TODO: Maybe this should be a configurable parameter? if ((!Socket.OSSupportsIPv4) && (Socket.OSSupportsIPv6)) { ip = IPAddress.IPv6Any; } this.m_ListenEP = new IPEndPoint(ip, TCPListenPort); } m_AllClients = new Hashtable(); m_ReceiveQueue = new Queue(); this.m_Encoder = new Chunk.ChunkEncoder(); this.m_ServerSender = new TCPServerSender(instructor); //Start bridging if config file says so #if RTP_BUILD m_U2MBridge = null; string enableBridge = System.Configuration.ConfigurationManager.AppSettings[this.GetType().ToString() + ".EnableBridge"]; if (enableBridge != null) { bool enable = false; if (bool.TryParse(enableBridge, out enable) && enable) { Trace.WriteLine("Unicast to Multicast Bridge enabled.", this.GetType().ToString()); m_U2MBridge = new UnicastToMulticastBridge(model); } } #endif }
public ProtocolCollectionHelper(ClassroomsListView parent, NetworkModel network) : base(parent.m_EventQueue, network, "Protocols") { this.m_Parent = parent; base.Initialize(); }