/// <summary> /// 지정된 NetworkChannel만을 생성하고 네트워킹을 시작합니다. /// </summary> /// <param name="networkChannelName">시작할 NetworkChannel 이름</param> /// <returns>해당 NetworkChannel 객체</returns> public static NetworkChannel StartNetwork(String networkChannelName) { ConfigNetworkChannel config = _listNetworkConfig.Find(v => v.NetworkChannelName == networkChannelName); if (config == null) { throw new AegisException(AegisResult.InvalidArgument, "Invalid NetworkChannel name({0}).", networkChannelName); } NetworkChannel channel = NetworkChannel.CreateChannel(config.NetworkChannelName); if (config.ListenIpAddress.Length == 0 || config.ListenPortNo == 0) { channel.StartNetwork( delegate { return(GenerateSession(config.SessionClassName)); }, config.InitSessionPoolCount, config.MaxSessionPoolCount); } else { channel.StartNetwork( delegate { return(GenerateSession(config.SessionClassName)); }, config.InitSessionPoolCount, config.MaxSessionPoolCount) .OpenListener(config.ListenIpAddress, config.ListenPortNo); } return(channel); }
/// <summary> /// NetworkChannel을 생성하고 네트워킹을 시작합니다. /// </summary> public static void StartNetwork() { foreach (ConfigNetworkChannel config in _listNetworkConfig) { NetworkChannel channel = NetworkChannel.CreateChannel(config.NetworkChannelName); if (config.ListenPortNo == 0) { channel.StartNetwork( delegate { return(GenerateSession(config.SessionClassName)); }, config.InitSessionPoolCount, config.MaxSessionPoolCount); } else { channel.StartNetwork( delegate { return(GenerateSession(config.SessionClassName)); }, config.InitSessionPoolCount, config.MaxSessionPoolCount) .OpenListener(config.ListenIpAddress, config.ListenPortNo); } } }
/// <summary> /// 새로운 NetworkChannel을 생성합니다. /// 이 Method는 NetworkChannel.CreateChannel와 동일합니다. /// </summary> /// <param name="channelName">생성할 NetworkChannel의 고유이름</param> /// <returns>생성된 NetworkChannel 객체</returns> public static NetworkChannel CreateNetworkChannel(String channelName) { return(NetworkChannel.CreateChannel(channelName)); }