public void Connect() { _eventAwaiter = new TNT.Tests.EventAwaiter <IConnection <TOriginContractInterface, TcpChannel> >(); Server.AfterConnect += _eventAwaiter.EventRaised; Server.StartListening(); ClientChannel.Connect(new IPEndPoint(IPAddress.Loopback, 12345)); OriginConnection = _eventAwaiter.WaitOneOrDefault(500); Assert.IsNotNull(OriginConnection); }
public void Connect() { _eventAwaiter = new TNT.Tests.EventAwaiter <IConnection <TOriginContractInterface, TestChannel> >(); Server.AfterConnect += _eventAwaiter.EventRaised; Server.StartListening(); Server.TestListener.ImmitateAccept(ClientChannel); OriginConnection = _eventAwaiter.WaitOneOrDefault(500); Assert.IsNotNull(OriginConnection); }
public TcpConnectionPair(PresentationBuilder <TOriginContractInterface> originBuilder, PresentationBuilder <TProxyContractInterface> proxyBuider, bool connect = true) { Server = originBuilder.CreateTcpServer(IPAddress.Loopback, 12345); ClientChannel = new TcpChannel(); ProxyConnection = proxyBuider.UseChannel(ClientChannel).Build(); _eventAwaiter = new TNT.Tests.EventAwaiter <IConnection <TOriginContractInterface, TcpChannel> >(); Server.AfterConnect += _eventAwaiter.EventRaised; if (connect) { Connect(); } }