예제 #1
0
 /// <summary>
 /// Initializes new instance of <see cref="Server"/>.
 /// </summary>
 /// <param name="url">The url to host the server on.</param>
 /// <param name="resolver">The dependency resolver for the server.</param>
 public Server(string url, IDependencyResolver resolver)
     : base(resolver)
 {
     _url      = url.Replace("*", @".*?");
     _listener = new HttpListener();
     _listener.Prefixes.Add(url);
     _disconnectHandler = new DisconnectHandler(_listener);
 }
예제 #2
0
파일: Server.cs 프로젝트: rajjan/SignalR
 /// <summary>
 /// Initializes new instance of <see cref="Server"/>.
 /// </summary>
 /// <param name="url">The url to host the server on.</param>
 /// <param name="resolver">The dependency resolver for the server.</param>
 public Server(string url, IDependencyResolver resolver)
     : base(resolver)
 {
     _url = url.Replace("*", @".*?");
     _listener = new HttpListener();
     _listener.Prefixes.Add(url);
     _disconnectHandler = new DisconnectHandler(_listener);
 }
예제 #3
0
 /// <summary>
 /// Initializes new instance of <see cref="Server"/>.
 /// </summary>
 /// <param name="url">The url to host the server on.</param>
 /// <param name="resolver">The dependency resolver for the server.</param>
 public Server(string url, IDependencyResolver resolver)
     : base(resolver)
 {
     _url      = url.Replace("*", @".*?");
     _listener = new HttpListener();
     _listener.Prefixes.Add(url);
     _disconnectHandler = new DisconnectHandler(_listener);
     resolver.InitializePerformanceCounters(Process.GetCurrentProcess().GetUniqueInstanceName(_shutdownToken.Token), _shutdownToken.Token);
 }
예제 #4
0
파일: Server.cs 프로젝트: neiz/SignalR
 /// <summary>
 /// Initializes new instance of <see cref="Server"/>.
 /// </summary>
 /// <param name="url">The url to host the server on.</param>
 /// <param name="resolver">The dependency resolver for the server.</param>
 public Server(string url, IDependencyResolver resolver)
     : base(resolver)
 {
     _url = url.Replace("*", @".*?");
     _listener = new HttpListener();
     _listener.Prefixes.Add(url);
     _disconnectHandler = new DisconnectHandler(_listener);
     resolver.InitializePerformanceCounters(Process.GetCurrentProcess().GetUniqueInstanceName(_shutdownToken.Token), _shutdownToken.Token);
 }
예제 #5
0
 /// <summary>
 /// Create an instance of <see cref="WebAppServer"/>.
 /// </summary>
 /// <param name="urlReservation">
 /// The URL reservation to listen on. This string is similar to a URL, but the
 /// hostname may be a strong wildcard ('+') or a weak wildcard ('*'). E.g. "http://+:8080/".
 /// </param>
 public WebAppServer(string urlReservation)
 {
     _urlRegex = new Regex("^" + urlReservation.Replace("*", ".*?").Replace("+", ".*?"), RegexOptions.IgnoreCase);
     _listener = new HttpListener();
     _listener.Prefixes.Add(urlReservation);
     _disconnectHandler = new DisconnectHandler(_listener);
     var uri = new Uri(urlReservation.Replace("*", "localhost").Replace("+", "localhost"));
     _webAppConfiguration = new WebAppConfiguration(uri);
     StaticFiles = new StaticFileSpecCollection();
 }