IServerConfig.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Configuration;
  5. using System.Security.Authentication;
  6. using System.Collections.Specialized;
  7. namespace SuperSocket.SocketBase.Config
  8. {
  9. /// <summary>
  10. /// Server instance configuation interface
  11. /// </summary>
  12. public partial interface IServerConfig
  13. {
  14. /// <summary>
  15. /// Gets the name of the server type this appServer want to use.
  16. /// </summary>
  17. /// <value>
  18. /// The name of the server type.
  19. /// </value>
  20. string ServerTypeName { get; }
  21. /// <summary>
  22. /// Gets the type definition of the appserver.
  23. /// </summary>
  24. /// <value>
  25. /// The type of the server.
  26. /// </value>
  27. string ServerType { get; }
  28. /// <summary>
  29. /// Gets the Receive filter factory.
  30. /// </summary>
  31. string ReceiveFilterFactory { get; }
  32. /// <summary>
  33. /// Gets the ip.
  34. /// </summary>
  35. string Ip { get; }
  36. /// <summary>
  37. /// Gets the port.
  38. /// </summary>
  39. int Port { get; }
  40. /// <summary>
  41. /// Gets the options.
  42. /// </summary>
  43. NameValueCollection Options { get; }
  44. /// <summary>
  45. /// Gets the option elements.
  46. /// </summary>
  47. NameValueCollection OptionElements { get; }
  48. /// <summary>
  49. /// Gets a value indicating whether this <see cref="IServerConfig"/> is disabled.
  50. /// </summary>
  51. /// <value>
  52. /// <c>true</c> if disabled; otherwise, <c>false</c>.
  53. /// </value>
  54. bool Disabled { get; }
  55. /// <summary>
  56. /// Gets the name.
  57. /// </summary>
  58. string Name { get; }
  59. /// <summary>
  60. /// Gets the mode.
  61. /// </summary>
  62. SocketMode Mode { get; }
  63. /// <summary>
  64. /// Gets the send time out.
  65. /// </summary>
  66. int SendTimeOut { get; }
  67. /// <summary>
  68. /// Gets the max connection number.
  69. /// </summary>
  70. int MaxConnectionNumber { get; }
  71. /// <summary>
  72. /// Gets the size of the receive buffer.
  73. /// </summary>
  74. /// <value>
  75. /// The size of the receive buffer.
  76. /// </value>
  77. int ReceiveBufferSize { get; }
  78. /// <summary>
  79. /// Gets the size of the send buffer.
  80. /// </summary>
  81. /// <value>
  82. /// The size of the send buffer.
  83. /// </value>
  84. int SendBufferSize { get; }
  85. /// <summary>
  86. /// Gets a value indicating whether sending is in synchronous mode.
  87. /// </summary>
  88. /// <value>
  89. /// <c>true</c> if [sync send]; otherwise, <c>false</c>.
  90. /// </value>
  91. bool SyncSend { get; }
  92. /// <summary>
  93. /// Gets a value indicating whether log command in log file.
  94. /// </summary>
  95. /// <value><c>true</c> if log command; otherwise, <c>false</c>.</value>
  96. bool LogCommand { get; }
  97. /// <summary>
  98. /// Gets a value indicating whether clear idle session.
  99. /// </summary>
  100. /// <value><c>true</c> if clear idle session; otherwise, <c>false</c>.</value>
  101. bool ClearIdleSession { get; }
  102. /// <summary>
  103. /// Gets the clear idle session interval, in seconds.
  104. /// </summary>
  105. /// <value>The clear idle session interval.</value>
  106. int ClearIdleSessionInterval { get; }
  107. /// <summary>
  108. /// Gets the idle session timeout time length, in seconds.
  109. /// </summary>
  110. /// <value>The idle session time out.</value>
  111. int IdleSessionTimeOut { get; }
  112. /// <summary>
  113. /// Gets X509Certificate configuration.
  114. /// </summary>
  115. /// <value>X509Certificate configuration.</value>
  116. ICertificateConfig Certificate { get; }
  117. /// <summary>
  118. /// Gets the security protocol, X509 certificate.
  119. /// </summary>
  120. string Security { get; }
  121. /// <summary>
  122. /// Gets the length of the max request.
  123. /// </summary>
  124. /// <value>
  125. /// The length of the max request.
  126. /// </value>
  127. int MaxRequestLength { get; }
  128. /// <summary>
  129. /// Gets a value indicating whether [disable session snapshot].
  130. /// </summary>
  131. /// <value>
  132. /// <c>true</c> if [disable session snapshot]; otherwise, <c>false</c>.
  133. /// </value>
  134. bool DisableSessionSnapshot { get; }
  135. /// <summary>
  136. /// Gets the interval to taking snapshot for all live sessions.
  137. /// </summary>
  138. int SessionSnapshotInterval { get; }
  139. /// <summary>
  140. /// Gets the connection filters used by this server instance.
  141. /// </summary>
  142. /// <value>
  143. /// The connection filter's name list, seperated by comma
  144. /// </value>
  145. string ConnectionFilter { get; }
  146. /// <summary>
  147. /// Gets the command loader, multiple values should be separated by comma.
  148. /// </summary>
  149. string CommandLoader { get; }
  150. /// <summary>
  151. /// Gets the start keep alive time, in seconds
  152. /// </summary>
  153. int KeepAliveTime { get; }
  154. /// <summary>
  155. /// Gets the keep alive interval, in seconds.
  156. /// </summary>
  157. int KeepAliveInterval { get; }
  158. /// <summary>
  159. /// Gets the backlog size of socket listening.
  160. /// </summary>
  161. int ListenBacklog { get; }
  162. /// <summary>
  163. /// Gets the startup order of the server instance.
  164. /// </summary>
  165. int StartupOrder { get; }
  166. /// <summary>
  167. /// Gets the child config.
  168. /// </summary>
  169. /// <typeparam name="TConfig">The type of the config.</typeparam>
  170. /// <param name="childConfigName">Name of the child config.</param>
  171. /// <returns></returns>
  172. TConfig GetChildConfig<TConfig>(string childConfigName)
  173. where TConfig : ConfigurationElement, new();
  174. /// <summary>
  175. /// Gets the listeners' configuration.
  176. /// </summary>
  177. IEnumerable<IListenerConfig> Listeners { get; }
  178. /// <summary>
  179. /// Gets the log factory name.
  180. /// </summary>
  181. string LogFactory { get; }
  182. /// <summary>
  183. /// Gets the size of the sending queue.
  184. /// </summary>
  185. /// <value>
  186. /// The size of the sending queue.
  187. /// </value>
  188. int SendingQueueSize { get; }
  189. /// <summary>
  190. /// Gets a value indicating whether [log basic session activity like connected and disconnected].
  191. /// </summary>
  192. /// <value>
  193. /// <c>true</c> if [log basic session activity]; otherwise, <c>false</c>.
  194. /// </value>
  195. bool LogBasicSessionActivity { get; }
  196. /// <summary>
  197. /// Gets a value indicating whether [log all socket exception].
  198. /// </summary>
  199. /// <value>
  200. /// <c>true</c> if [log all socket exception]; otherwise, <c>false</c>.
  201. /// </value>
  202. bool LogAllSocketException { get; }
  203. /// <summary>
  204. /// Gets the default text encoding.
  205. /// </summary>
  206. /// <value>
  207. /// The text encoding.
  208. /// </value>
  209. string TextEncoding { get; }
  210. /// <summary>
  211. /// Gets the command assemblies configuration.
  212. /// </summary>
  213. /// <value>
  214. /// The command assemblies.
  215. /// </value>
  216. IEnumerable<ICommandAssemblyConfig> CommandAssemblies { get; }
  217. }
  218. }