private bool OpenConnectionToService() { if (sHost != null) { return(false); } try { AddTextString("Creating transcoder notifier."); NotifierURI = GetNotifierUri(); sHost = new ServiceHost(typeof(TranscodingNotifyingService), new Uri(NotifierURI)); sHost.AddServiceEndpoint(typeof(ITranscodingNotifyingService), WCFUtilites.NetTcpBinding(), NotifierURI); sHost.Open(); AddTextString("Creating transcoder service proxy."); var host = NewTranscodingServiceProxy(); AddTextString("Registering notifier with service."); host.Channel.RegisterNotifyer(NotifierURI, true); AddTextString("Successfully connected to transcoder service."); AddTextString(""); return(true); } catch { AddTextString("Failed to connect to transcoder service. Check Windows firewall."); AddTextString(""); return(false); } }
protected override void OnStop() { WCFUtilites.StopService(EventSource, ref _transcodingServiceHost); //WCFUtilites.StopService(EventSource, ref _trailersProxyServiecHost); _trailersProxyService.Server.Stop(); //WCFUtilites.StopService(EventSource, ref _titleCollectionServiceHost); WriteToLog(System.Diagnostics.EventLogEntryType.Information, "OMLEngineService Stop"); }
protected override void OnStart(string[] args) { #if DEBUG System.Diagnostics.Debugger.Launch(); #endif WriteToLog(System.Diagnostics.EventLogEntryType.Information, "OMLEngineService Start"); _transcodingServiceHost = WCFUtilites.StartService(EventSource, typeof(TranscodingService)); //_titleCollectionServiceHost = WCFUtilites.StartService(EventSource, typeof(TitleCollectionAPI)); //_trailersProxyServiecHost = WCFUtilites.StartService(EventSource, typeof(TrailersProxyService)); _trailersProxyService = new TrailersProxyService(); }
public static void Start() { if (sHost != null) { Stop(); //return; } sURI = GetNotifierUri(); sHost = new ServiceHost(typeof(TranscodingNotifyingService), new Uri(sURI)); sHost.AddServiceEndpoint(typeof(ITranscodingNotifyingService), WCFUtilites.NetTcpBinding(), sURI); sHost.Open(); Utilities.DebugLine("[TranscodingNotifier] Starting WCF notifying service: {0}", sURI); using (var host = NewTranscodingServiceProxy()) host.Channel.RegisterNotifyer(sURI, true); }
internal static void WriteToLog(System.Diagnostics.EventLogEntryType type, string msg, params object[] args) { WCFUtilites.WriteToLog(EventSource, type, msg, args); }
public MyClientBase <ITranscodingNotifyingService> NewTranscodingNotifyingServiceProxy(string uri) { return(new MyClientBase <ITranscodingNotifyingService>(WCFUtilites.NetTcpBinding(), new EndpointAddress(uri))); }
public MyClientBase <ITranscodingService> NewTranscodingServiceProxy() { return(new MyClientBase <ITranscodingService>(WCFUtilites.NetTcpBinding(), new EndpointAddress("net.tcp://localhost:8321/OMLTS"))); }
public string GetNotifierUri() { return(string.Format("net.tcp://localhost:{0}/OMLTNS", WCFUtilites.FreeTcpPort())); }