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); } }
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); }
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"))); }