protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            mojoServiceHost customServiceHost;

            int preferredHostIndex = -1;
            if (IsAppService(serviceType))
            {
                preferredHostIndex = GetAppServicePreferredHostIndex(baseAddresses);
            }
            else
            {
                preferredHostIndex = GetPreferredHostIndex(baseAddresses);
            }

            if (preferredHostIndex > -1)
            {
                customServiceHost = new mojoServiceHost(serviceType, baseAddresses[preferredHostIndex]);
                return customServiceHost;
            }

            customServiceHost = new mojoServiceHost(serviceType, baseAddresses[0]);
            return customServiceHost;
        }
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            mojoServiceHost customServiceHost;

            int preferredHostIndex = -1;

            if (IsAppService(serviceType))
            {
                preferredHostIndex = GetAppServicePreferredHostIndex(baseAddresses);
            }
            else
            {
                preferredHostIndex = GetPreferredHostIndex(baseAddresses);
            }

            if (preferredHostIndex > -1)
            {
                customServiceHost = new mojoServiceHost(serviceType, baseAddresses[preferredHostIndex]);
                return(customServiceHost);
            }

            customServiceHost = new mojoServiceHost(serviceType, baseAddresses[0]);
            return(customServiceHost);
        }