Esempio n. 1
0
        /// <summary>
        /// builds a host on the Loopback address (with next avail port) that ONLY allows clients also
        /// coming from the Loopback.  This is great for local machine IPC
        /// </summary>
        /// <param name="logic"></param>
        /// <returns></returns>
        public IEndPointHost BuildNextAvailableLocalOnlyHost(IEndPointLogic logic)
        {
            //get the next available local ip
            var ep = EndPointHelper.GetNextFreeLoopbackEndPoint();

            Condition.Requires(ep).IsNotNull();

            Func <System.Net.IPEndPoint, bool> validator = (x) =>
            {
                return(x.Address.Equals(System.Net.IPAddress.Loopback));
            };

            return(this.BuildEndPointHost(ep, logic, validator));
        }