public PersonInformation(TcpClient thisClient, string thisName) { if (thisClient == null) { client = null; comms = null; name = thisName; isHost = true; } else { client = thisClient; comms = new NetObject(client); name = thisName; isHost = false; } }
public void ConnectAndGo(IPAddress ip, ushort port) { //Connect try { client.Connect(ip, port); } catch (SocketException) { theForm.dgShowError("Failed to connect to host", true); return; } //Create NetObject comms = new NetObject(client); //Create thread Thread threadMgr = new Thread(new ThreadStart(StartGuestManagement)) { IsBackground = true, Name = "Guest Manager" }; threadMgr.Start(); }
public PersonInformation(TcpClient thisClient) { if (thisClient == null) { client = null; comms = null; name = "HOST"; isHost = true; isReady = false; } else { client = thisClient; comms = new NetObject(client); name = "GUEST"; isHost = false; isReady = false; } }