コード例 #1
0
 public NetworkServer(int port = 11000, NetworkConfig config = null)
 {
     if (config == null)
     {
         config             = new NetworkConfig();
         config.networkType = NetworkType.Server;
         config.port        = port;
         config.localIP     = GetLocalIP();
         config.serverIP    = config.localIP;
     }
     this.config = config;
     base.ThreadInit( );
     SetNextTask(MyTask.StartServer);
 }
コード例 #2
0
        public NetworkClient(string ServerIP, int port = 11000)
        {
            ServerIP = ServerIP.Replace(" ", string.Empty);
            var config = new NetworkConfig();

            config.localIP     = GetLocalIP();
            config.serverIP    = ServerIP;
            config.port        = port;
            config.networkType = NetworkType.Client;

            this.config = config;
            base.ThreadInit();
            SetNextTask(MyTask.StartClient);
        }