// try to bind httpport, launch WebGateway threads, and listen to Interfaces' changes public bool StartService() { bool success = false; try { // TODO: collects gateways to a List<MIGGateway> and expose it by public member Gateways // webGateway.Configure(webServiceConfig); webGateway.ProcessRequest += webGateway_ProcessRequest; webGateway.Start(); // tcpGateway.Configure(new TcpSocketGatewayConfiguration() { Port = tcpGatewayPort }); tcpGateway.ProcessRequest += tcpGateway_ProcessRequest; tcpGateway.Start(); // success = true; } catch (Exception ex) { webGateway = new WebServiceGateway(); tcpGateway = new TcpSocketGateway(); // TODO: add error logging } return success; }
public MIGService() { webGateway = new WebServiceGateway(); tcpGateway = new TcpSocketGateway(); // Interfaces = new Dictionary<string, MIGInterface>(); // webServiceConfig = new WebServiceGatewayConfiguration() { Port = 80, SslPort = 443, HomePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html"), BaseUrl = "hg/html", Password = "" }; }