Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 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");
 }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 internal static void WriteToLog(System.Diagnostics.EventLogEntryType type, string msg, params object[] args)
 {
     WCFUtilites.WriteToLog(EventSource, type, msg, args);
 }
Beispiel #6
0
 public MyClientBase <ITranscodingNotifyingService> NewTranscodingNotifyingServiceProxy(string uri)
 {
     return(new MyClientBase <ITranscodingNotifyingService>(WCFUtilites.NetTcpBinding(), new EndpointAddress(uri)));
 }
Beispiel #7
0
 public MyClientBase <ITranscodingService> NewTranscodingServiceProxy()
 {
     return(new MyClientBase <ITranscodingService>(WCFUtilites.NetTcpBinding(), new EndpointAddress("net.tcp://localhost:8321/OMLTS")));
 }
Beispiel #8
0
 public string GetNotifierUri()
 {
     return(string.Format("net.tcp://localhost:{0}/OMLTNS", WCFUtilites.FreeTcpPort()));
 }