Beispiel #1
0
        /// <summary>
        /// new
        /// </summary>
        /// <param name="config"></param>
        /// <param name="port"></param>
        /// <param name="socketService"></param>
        /// <param name="socketBufferSize"></param>
        /// <param name="messageBufferSize"></param>
        /// <param name="maxMessageSize"></param>
        /// <param name="maxConnections"></param>
        /// <exception cref="ArgumentNullException">config is null.</exception>
        public ThriftServer(Config.ServiceConfig config,
                            int port,
                            ThriftService socketService,
                            int socketBufferSize,
                            int messageBufferSize,
                            int maxMessageSize,
                            int maxConnections)
            : base(port, socketService, new ThriftProtocol(), socketBufferSize, messageBufferSize, maxMessageSize, maxConnections)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            this.Port   = port;
            this.Config = config;
        }
 /// <summary>
 /// set config
 /// </summary>
 /// <param name="config"></param>
 public void Init(Config.ServiceConfig config)
 {
     if (config == null) throw new ArgumentNullException("config");
     this._config = config;
     this._methods = string.Join(",", Type.GetType(config.ServiceType).GetInterfaces()[0].GetMethods().Select(c => c.Name).ToArray());
 }