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); }
public MyUdpServer(IDirectService service, IBusSwitch bus) { _bus = bus; _service = service; NewSessionConnected += MyAbc_NewSessionConnected; }