Example #1
0
 /// <summary>
 /// Initializes an OWIN host with a random port.
 /// </summary>
 /// <remarks>
 /// Tries 10 times to listen on random port in the range 48620-49150
 /// (see <a href="http://stackoverflow.com/questions/2200199/how-do-you-decide-what-port-to-use">How do you decide what port to use</a>
 /// discussion in Stack Overflow.
 /// </remarks>
 /// <param name="removeOwinTraceListeners">Whether to remove the trace listeners added by OWIN.</param>
 /// <returns>A dispose to close the OWIN host.</returns>
 /// <exception cref="OwinFailedToStartException">Starting OWIN failed every time.</exception>
 public static IDisposable InitializeOwinWithRandomPort(bool removeOwinTraceListeners)
 {
     return(OwinInitializer.InitializeOwinWithRandomPort(removeOwinTraceListeners, 10));
 }
Example #2
0
 /// <summary>
 /// Initializes an OWIN host with a random port.
 /// </summary>
 /// <param name="removeOwinTraceListeners">Whether to remove the trace listeners added by OWIN.</param>
 /// <param name="minPort">The minimum port that can be used.</param>
 /// <param name="maxPort">The maximum port that can be used.</param>
 /// <param name="maxAttempts">The maximum number of attempts to listen on random port.</param>
 /// <returns>A dispose to close the OWIN host.</returns>
 /// <exception cref="OwinFailedToStartException">Starting OWIN failed every time.</exception>
 public static IDisposable InitializeOwinWithRandomPort(bool removeOwinTraceListeners, int minPort, int maxPort, int maxAttempts)
 {
     return(OwinInitializer.InitializeOwin(true, OwinInitializer.InitializeOwinWithRandomPort));
 }
Example #3
0
 /// <summary>
 /// Initializes an OWIN host with a random port.
 /// </summary>
 /// <remarks>
 /// Tries to listen on random port in the range 48620-49150
 /// (see <a href="http://stackoverflow.com/questions/2200199/how-do-you-decide-what-port-to-use">How do you decide what port to use</a>
 /// discussion in Stack Overflow.
 /// </remarks>
 /// <param name="removeOwinTraceListeners">Whether to remove the trace listeners added by OWIN.</param>
 /// <param name="maxAttempts">The maximum number of attempts to listen on random port.</param>
 /// <returns>A dispose to close the OWIN host.</returns>
 /// <exception cref="OwinFailedToStartException">Starting OWIN failed every time.</exception>
 public static IDisposable InitializeOwinWithRandomPort(bool removeOwinTraceListeners, int maxAttempts)
 {
     return(OwinInitializer.InitializeOwinWithRandomPort(removeOwinTraceListeners, 48620, 49150, maxAttempts));
 }
Example #4
0
 /// <summary>
 /// Initializes an OWIN host.
 /// </summary>
 /// <param name="removeOwinTraceListeners">Whether to remove the trace listeners added by OWIN.</param>
 /// <param name="port">The port on which OWIN should listen.</param>
 /// <returns>A dispose to close the OWIN host.</returns>
 /// <exception cref="OwinFailedToStartException">Starting OWIN failed.</exception>
 public static IDisposable InitializeOwin(bool removeOwinTraceListeners, int port)
 {
     return(OwinInitializer.InitializeOwin(true, () => Startup.StartOwinHost(port)));
 }