/// <summary> /// Initializes a new instance of the <see cref="RemoteServer"/> class using the specified port, relative path, and logger. /// </summary> /// <param name="basePath">The base path of the server to listen on.</param> /// <param name="port">The port to listen on.</param> /// <param name="path">The relative path to connect to.</param> /// <param name="handlerFactory">A <see cref="CommandHandlerFactory"/> used to create <see cref="CommandHandler"/> instances for handling commands.</param> /// <param name="log">A <see cref="Logger"/> object describing how to log information about commands executed.</param> protected RemoteServer(string basePath, int port, string path, CommandHandlerFactory handlerFactory, Logger log) { if (path == null) { throw new ArgumentNullException("path", "path cannot be null"); } this.handlerFactory = handlerFactory; this.listenerPort = port; if (!path.EndsWith("/", StringComparison.OrdinalIgnoreCase)) { path = path + "/"; } if (!path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) { path = "/" + path; } this.listenerPath = path; this.listenerPrefix = string.Format(CultureInfo.InvariantCulture, "http://{0}:{1}{2}", basePath, this.listenerPort, this.listenerPath); this.serverLogger = log; }
/// <summary> /// Initializes a new instance of the <see cref="RemoteWebDriverServer"/> class using the specified port, relative path, and logger. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="path">The relative path to connect to.</param> /// <param name="handlerFactory">A <see cref="CommandHandlerFactory"/> used to create <see cref="CommandHandler"/> instances for handling commands.</param> /// <param name="log">A <see cref="Logger"/> object describing how to log information about commands executed.</param> private RemoteWebDriverServer(int port, string path, CommandHandlerFactory handlerFactory, Logger log) : base(port, path, handlerFactory, log) { SessionManager.Instance.DriverRegistrationFailed += new EventHandler <DriverRegistrationFailedEventArgs>(this.Instance_DriverRegistrationFailed); this.InitializeSessionManager(); }
/// <summary> /// Initializes a new instance of the <see cref="RemoteServer"/> class using the specified port and relative path. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="path">The relative path to connect to.</param> /// <param name="handlerFactory">A <see cref="CommandHandlerFactory"/> used to create <see cref="CommandHandler"/> instances for handling commands.</param> protected RemoteServer(int port, string path, CommandHandlerFactory handlerFactory) : this(port, path, handlerFactory, new ConsoleLogger(LogLevel.Info)) { }
/// <summary> /// Initializes a new instance of the <see cref="RemoteServer"/> class using the specified port and relative path. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="path">The relative path to connect to.</param> /// <param name="handlerFactory">A <see cref="CommandHandlerFactory"/> used to create <see cref="CommandHandler"/> instances for handling commands.</param> /// <param name="log">A <see cref="Logger"/> used to log information in the server.</param> protected RemoteServer(int port, string path, CommandHandlerFactory handlerFactory, Logger log) : this("*", port, path, handlerFactory, log) { }
/// <summary> /// Initializes a new instance of the <see cref="RemoteWebDriverServer"/> class using the specified port, relative path, and logger. /// </summary> /// <param name="port">The port to listen on.</param> /// <param name="path">The relative path to connect to.</param> /// <param name="handlerFactory">A <see cref="CommandHandlerFactory"/> used to create <see cref="CommandHandler"/> instances for handling commands.</param> /// <param name="log">A <see cref="Logger"/> object describing how to log information about commands executed.</param> private RemoteWebDriverServer(int port, string path, CommandHandlerFactory handlerFactory, Logger log) : base(port, path, handlerFactory, log) { SessionManager.Instance.DriverRegistrationFailed += new EventHandler<DriverRegistrationFailedEventArgs>(this.Instance_DriverRegistrationFailed); this.InitializeSessionManager(); }