Exemplo n.º 1
0
        public SocClient(GCPacket mGCP, string ServerIpAddr, int Port)
        {
            mGCPacket = mGCP;
            mServerIp = ServerIpAddr;
            mServerPort = Port;

            mThread = new Thread(new ThreadStart(Service));
            mThread.Start();
        }
Exemplo n.º 2
0
        public SocServer(GCPacket GCP, int Port)
        {
            listener = new TcpListener(Port);
            listener.Start();
            mGCPacket = GCP;

            for (int i = 0; i < LIMIT; i++)
            {
                mThreads[i] = new Thread(new ThreadStart(Service));
                mThreads[i].Start();
            }
        }
Exemplo n.º 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     this.ImClient = true;
     if (ClientStarted == false)
     {
         ClientStarted = true;
         mGCPacketSocClient = new GCPacket();
         mSocClient = new SocClient(mGCPacketSocClient, this.textBox3.Text, Convert.ToInt32(this.textBox4.Text));
     }
     mGCPacketSocClient.clear();
     this.textBox1.Text = mGCPacketSocClient.id.ToString();
     this.textBox2.Text = mGCPacketSocClient.pw;
 }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.ImClient = false;
            if (ServerStarted == false)
            {
                mGCPacketSocServer = new GCPacket();
                mSocServer = new SocServer(mGCPacketSocServer, Convert.ToInt32(this.textBox4.Text));

                ServerStarted = true;
            }
            mGCPacketSocServer.id = mImgProc.mCurrentRoomId;
            mGCPacketSocServer.GenerateKey();
        }