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