Ejemplo n.º 1
0
        public IDirectService GetDirectService()
        {
            if (_direct == null)
            {
                var url      = new Uri(TestingServer.BaseAddress, "direct");
                var binding  = new BasicHttpBinding();
                var endpoint = new EndpointAddress(url);
                var factory  = new ChannelFactory <IDirectService>(binding, endpoint);
                var client   = factory.CreateChannel();
                _direct = client;

                var channel = client as ICommunicationObject;
                channel.Closed += (sender, args) =>
                {
                    _direct = null;
                };
            }
            return(_direct);
        }
Ejemplo n.º 2
0
 public MyUdpServer(IDirectService service, IBusSwitch bus)
 {
     _bus                 = bus;
     _service             = service;
     NewSessionConnected += MyAbc_NewSessionConnected;
 }