public TCPConnection(TCPRole role, IPAddress serverIP, int serverPort) { switch (role) { case TCPRole.Server: try { this.ServerRef = new Server(serverPort); this.ServerRef.Start(); } catch (FormatException e) { Console.WriteLine("Unexceped exception occured: " + e); } break; case TCPRole.Client: try { this.ClientRef = new ClientThread(this, serverIP, serverPort); this.ClientRef.Start(); } catch (FormatException e) { Console.WriteLine("Unexceped exception occured: " + e); } break; default: // The current settings don't match for using a tcp connection. // This application is used as desktop client of MISD. break; } }
public NetworkStatus(ConnectionStatus connectionStatus, ConnectionProtocolType protocolType, TCPRole tcpRole, int clientCount, string classroomName) { this.ConnectionStatus = connectionStatus; this.ProtocolType = protocolType; this.TCPRole = tcpRole; this.ClientCount = clientCount; this.ClassroomName = classroomName; }
public NetworkStatus(ConnectionStatus connectionStatus, ConnectionProtocolType protocolType, TCPRole tcpRole, int clientCount) : this(connectionStatus, protocolType, tcpRole, clientCount, "") { }