schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System.Configuration;
 
namespace Sodao.FastSocket.Server.Config
{
    /// <summary>
    /// server
    /// </summary>
    public class Server : ConfigurationElement
    {
        /// <summary>
        /// 名称
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true)]
        public string Name
        {
            get { return (string)this["name"]; }
        }
        /// <summary>
        /// 端口号。
        /// </summary>
        [ConfigurationProperty("port", IsRequired = true, DefaultValue = 2018, IsKey = false)]
        public int Port
        {
            get { return (int)this["port"]; }
            set { this["port"] = value; }
        }
 
        /// <summary>
        /// Socket Buffer Size
        /// 默认8192 bytes
        /// </summary>
        [ConfigurationProperty("socketBufferSize", IsRequired = false, DefaultValue = 8192)]
        public int SocketBufferSize
        {
            get { return (int)this["socketBufferSize"]; }
        }
        /// <summary>
        /// Message Buffer Size
        /// 默认1024 bytes
        /// </summary>
        [ConfigurationProperty("messageBufferSize", IsRequired = false, DefaultValue = 8192)]
        public int MessageBufferSize
        {
            get { return (int)this["messageBufferSize"]; }
        }
        /// <summary>
        /// max message size,
        /// 默认4MB
        /// </summary>
        [ConfigurationProperty("maxMessageSize", IsRequired = false, DefaultValue = 1024 * 1024 * 4)]
        public int MaxMessageSize
        {
            get { return (int)this["maxMessageSize"]; }
        }
        /// <summary>
        /// 最大连接数,默认2W
        /// </summary>
        [ConfigurationProperty("maxConnections", IsRequired = false, DefaultValue = 20000)]
        public int MaxConnections
        {
            get { return (int)this["maxConnections"]; }
        }
 
        /// <summary>
        /// ServiceType
        /// </summary>
        [ConfigurationProperty("serviceType", IsRequired = true)]
        public string ServiceType
        {
            get { return (string)this["serviceType"]; }
        }
        /// <summary>
        /// 协议, 默认命令行协议
        /// </summary>
        [ConfigurationProperty("protocol", IsRequired = false, DefaultValue = "commandLine")]
        public string Protocol
        {
            get { return (string)this["protocol"]; }
        }
    }
}