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); }
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); }