Exemple #1
0
    public MyServiceClient(IMyServiceCallback Callback)
    {
        InstanceContext     site            = new InstanceContext(Callback);
        NetNamedPipeBinding binding         = new NetNamedPipeBinding();
        EndpointAddress     endpointAddress = new EndpointAddress(Constants.myPipeService + @"/" + Constants.myPipeServiceName);

        myServiceFactory = new DuplexChannelFactory <IMyService>(site, binding, endpointAddress);
    }
Exemple #2
0
        public void OpenSession()
        {
            Console.WriteLine("> Session opened at {0}", DateTime.Now);
            Callback = OperationContext.Current.GetCallbackChannel <IMyServiceCallback>();

            Timer          = new Timer(1000);
            Timer.Elapsed += OnTimerElapsed;
            Timer.Enabled  = true;
        }
        public void OpenSession()
        {
            Console.WriteLine("> Session opened at {0}", DateTime.Now);
            Callback = OperationContext.Current.GetCallbackChannel<IMyServiceCallback>();

            Timer = new Timer(1000);
            Timer.Elapsed += OnTimerElapsed;
            Timer.Enabled = true;
        }
    public bool CallService()
    {
        IMyServiceCallback callback = OperationContext.Current.GetCallbackChannel <IMyServiceCallback>();

        Task.Factory.StartNew((cb) => cb.NotifyClient(), callback);
    }