示例#1
0
 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;
     }
 }
示例#2
0
        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();
        }
示例#3
0
 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;
     }
 }