/// <summary> /// This class attaches a Windows Service to Consul. You muse either override or do /// base.OnStart()/OnStop() to activate the Consul integration! /// </summary> /// <param name="serviceName">Name of the service starting</param> /// <param name="port">TCP Port the service talks upon.</param> /// <param name="statusRoute"></param> /// <param name="tags">Tags to register in consul</param> protected WindowsServiceBase(String serviceName, int port, string statusRoute, string[] tags) { _serviceId = new ServiceId(serviceName, Guid.NewGuid().ToString()); _port = port; _statusRoute = statusRoute; _tags = tags.Where(x => !string.IsNullOrEmpty(x)).ToArray(); }
protected bool Equals(ServiceId other) { return(string.Equals(_svcName, other._svcName) && string.Equals(_id, other._id)); }