예제 #1
0
        public void Connect(string ip, int port)
        {
            if (isWorking)
            {
                DebugAdapter.Log("You already connect");
                return;
            }

            info = new ClientInfo(info.Name, info.hashPassword);
            info.ClientTCP.Connect(ip, port);
            stream = info.ClientTCP.GetStream();
            sendner.Start();
            isWorking = true;
            SendCommand <TemplateConnect>(info.Name + " " + info.hashPassword);
            sendner.asynListeningClient(info, allocServerSended, allocToDrop);
        }
예제 #2
0
        public void StartServer()
        {
            if (isWorking)
            {
                return;
            }

            isWorking = true;

            DebugAdapter.Log("Server is running");
            DebugAdapter.Log($"Server password: {ServerPassword}");


            listner.Start();
            sendner.Start();
            sendner.asynFindingClient(listner, ServerPassword, allocFindedClient, allocBreackServer);
        }