I've made a WCF Service to connect to a database and authenticate users, then I was thinking of how to host my service and IIS wasn't a good candidate in my opinion cause my service is going to be consumed by a small local network, so I figured it out to host my service on a windows service running on the server,so my question is if this pratice brings bad results related to performance or any other parameter?,this is the code for my windows service:
public partial class Service1 : ServiceBase
{
private ServiceHost _host;
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
_host = new ServiceHost(typeof(Cosmos.Service.Service1));
var binding = new WSHttpBinding();
_host.AddServiceEndpoint(typeof (IService1), binding, "http://localhost:4444");
_host.Open();
}
protected override void OnStop()
{
_host.Close();
}
protected override void OnContinue()
{
_host.Open();
}
protected override void OnPause()
{
_host.Close();
}
}