Beispiel #1
0
        /// <summary>
        /// returns a newly instantiated host with the given throttling.  The host is in the Uninitialized state.
        /// </summary>
        /// <param name="wireBuilderId"></param>
        /// <param name="port"></param>
        /// <param name="logic"></param>
        /// <param name="maxConnections"></param>
        /// <returns></returns>
        public static IEndPointHost BuildThrottledHost(string wireBuilderId, int port, IEndPointLogic logic, int maxConnections)
        {
            var builder       = EndPointHostBuilder.Instance.GetBuilder(wireBuilderId);
            var ep            = EndPointHelper.GetLocalEndPoint(port);
            var throttleLogic = ThrottleLogic(logic, maxConnections);
            var host          = builder.BuildEndPointHost(ep, throttleLogic);

            return(host);
        }