Пример #1
0
 private void Initialize()
 {
     Logger.Info(new string('-', 42));
     ServiceCallback = new ServiceCallback(this);
     WcfContext = new InstanceContext(ServiceCallback);
     Binding = new NetTcpBinding("NetTcpBinding_IWCFConnection");
     WcfAddress = new EndpointAddress($"net.tcp://{ConnectionSettings.Host}:{ConnectionSettings.Port}/TradingService");
     WcfClient = new WCFConnectionClient(WcfContext, Binding, WcfAddress);
 }
Пример #2
0
        private void Deinitialize()
        {
            Logger.Trace("Deinitializing connector");
            StopHeartbeat();

            DisposeCommunicationObject(WcfClient, TimeSpan.FromSeconds(0));
            WcfClient = null;
            DisposeCommunicationObject(WcfContext, TimeSpan.FromSeconds(5));
            WcfContext = null;

            ServiceCallback?.Dispose();
            ServiceCallback = null;
        }