コード例 #1
0
        internal void waitToBeTelled()
        {
            Console.WriteLine($"请输入IP地址!默认{this.IP}");
            var input = Console.ReadLine().Trim();

            if (!string.IsNullOrEmpty(input))
            {
                this.IP = input;
            }
            Console.WriteLine($"请输入端口。默认{this.Port}");
            input = Console.ReadLine().Trim();
            if (!string.IsNullOrEmpty(input))
            {
                this.Port = int.Parse(input);
            }
            var dealWith = new TcpFunction.WithoutResponse.DealWith(this.DealWith);

            TcpFunction.WithoutResponse.startTcp(this.IP, this.Port, dealWith);

            // Listen.IpAndPort(ip, tcpPort)
            // throw new NotImplementedException();
        }
コード例 #2
0
ファイル: Startup.cs プロジェクト: sxtgyrq/VRPGame
        private void startTcp()
        {
            var dealWithF = new TcpFunction.WithoutResponse.DealWith(StartTcpDealWithF);

            TcpFunction.WithoutResponse.startTcp(ConnectInfo.HostIP, ConnectInfo.tcpServerPort, dealWithF);
        }