using System.Configuration;
namespace Sodao.FastSocket.Server.Config
{
///
/// server
///
public class Server : ConfigurationElement
{
///
/// 名称
///
[ConfigurationProperty("name", IsRequired = true)]
public string Name
{
get { return (string)this["name"]; }
}
///
/// 端口号。
///
[ConfigurationProperty("port", IsRequired = true, DefaultValue = 2018, IsKey = false)]
public int Port
{
get { return (int)this["port"]; }
set { this["port"] = value; }
}
///
/// Socket Buffer Size
/// 默认8192 bytes
///
[ConfigurationProperty("socketBufferSize", IsRequired = false, DefaultValue = 8192)]
public int SocketBufferSize
{
get { return (int)this["socketBufferSize"]; }
}
///
/// Message Buffer Size
/// 默认1024 bytes
///
[ConfigurationProperty("messageBufferSize", IsRequired = false, DefaultValue = 8192)]
public int MessageBufferSize
{
get { return (int)this["messageBufferSize"]; }
}
///
/// max message size,
/// 默认4MB
///
[ConfigurationProperty("maxMessageSize", IsRequired = false, DefaultValue = 1024 * 1024 * 4)]
public int MaxMessageSize
{
get { return (int)this["maxMessageSize"]; }
}
///
/// 最大连接数,默认2W
///
[ConfigurationProperty("maxConnections", IsRequired = false, DefaultValue = 20000)]
public int MaxConnections
{
get { return (int)this["maxConnections"]; }
}
///
/// ServiceType
///
[ConfigurationProperty("serviceType", IsRequired = true)]
public string ServiceType
{
get { return (string)this["serviceType"]; }
}
///
/// 协议, 默认命令行协议
///
[ConfigurationProperty("protocol", IsRequired = false, DefaultValue = "commandLine")]
public string Protocol
{
get { return (string)this["protocol"]; }
}
}
}