Aegis.Network.NetworkChannel.CreateChannelFromNode C# (CSharp) Method

CreateChannelFromNode() public static method

TreeNode에 정의된 데이터를 기준으로 NetworkChannel 객체를 생성합니다. TreeNode에는 name, sessionClass, maxSessionPoolCount, listenIpAddress, listenPortNo가 정의되어있어야 합니다.
public static CreateChannelFromNode ( TreeNode node ) : NetworkChannel
node TreeNode 생성할 NetworkChannel의 데이터가 정의된 TreeNode
return NetworkChannel
        public static NetworkChannel CreateChannelFromNode(TreeNode<string> node)
        {
            lock (Channels)
            {
                string channelName = node.GetValue("name").ToString();
                if (Channels.Exists(channelName))
                    throw new AegisException(AegisResult.AlreadyExistName, "'{0}' is already exists channel name.", node.Name);

                NetworkChannel channel = new NetworkChannel(channelName);
                channel._configNode = node;
                channel.SessionGenerator = delegate { return GenerateSession(node.GetValue("sessionClass")); };
                channel.MaxSessionCount = node.GetValue("maxSessionCount").ToInt32();
                channel.Acceptor.ListenIpAddress = node.GetValue("listenIpAddress");
                channel.Acceptor.ListenPortNo = node.GetValue("listenPortNo").ToInt32();
                Channels.Add(channelName, channel);

                return channel;
            }
        }