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