Example #1
0
 /// <summary>
 /// Records a mapping between an address and the corresponding (transport, associationEventListener) pair.
 /// </summary>
 /// <param name="transport">The transport that is to be registered. The address of this transport will be used as a key.</param>
 /// <param name="associationEventListenerTask">The Task that will be completed with the listener that will handle the events for the given transport.</param>
 public void RegisterTransport(TestTransport transport, Task <IAssociationEventListener> associationEventListenerTask)
 {
     _transportTable.TryAdd(transport.LocalAddress, new Tuple <TestTransport, Task <IAssociationEventListener> >(transport, associationEventListenerTask));
 }
Example #2
0
 public TestAssociationHandle(Address localAddress, Address remoteAddress, TestTransport transport, bool inbound)
     : base(localAddress, remoteAddress)
 {
     Inbound    = inbound;
     _transport = transport;
 }
Example #3
0
        private Tuple <TestAssociationHandle, TestAssociationHandle> CreateHandlePair(TestTransport remoteTransport,
                                                                                      Address remoteAddress)
        {
            var localHandle  = new TestAssociationHandle(LocalAddress, remoteAddress, this, false);
            var remoteHandle = new TestAssociationHandle(remoteAddress, LocalAddress, remoteTransport, true);

            return(new Tuple <TestAssociationHandle, TestAssociationHandle>(localHandle, remoteHandle));
        }