public DemuxSocketListener(System.Uri uri, string type, DemuxSocketManager demuxManager)
 {
     this.uri             = uri;
     this.type            = type;
     this.demuxManager    = demuxManager;
     this.mutex           = new object();
     this.connectionQueue = new InputQueue <IConnection>();
 }
        public HybridConnectionListener(BindingContext context, TcpRelayTransportBindingElement transportBindingElement, int bufferSize, Uri uri, NameSettings nameSettings, TokenProvider tokenProvider)
        {
            this.bufferSize = bufferSize;
            IConnectionElement relayedSocketElement = new RelayedSocketElement(context, nameSettings, tokenProvider, SocketSecurityRole.None);
            DemuxSocketManager demuxSocketManager   = new DemuxSocketManager(relayedSocketElement, bufferSize, uri);
            IConnectionElement demuxSocketElement   = new DemuxSocketElement(relayedSocketElement, "relayed", demuxSocketManager);

            this.relayedSocketListener = demuxSocketElement.CreateListener(bufferSize, uri);
            this.relayedSocketAcceptor = new HybridConnectionListener.ConnectionAcceptor(this, this.relayedSocketListener, HybridConnectionListener.HybridConnectionSocketType.Relayed);
            IConnectionElement connectionElement = new DemuxSocketElement(relayedSocketElement, "direct", demuxSocketManager);
            Binding            binding           = HybridConnectionElement.CreateDirectControlBindingElement(context, transportBindingElement, connectionElement);

            this.directSocketListener = (new DirectSocketElement(binding)).CreateListener(bufferSize, uri);
            this.directSocketAcceptor = new HybridConnectionListener.ConnectionAcceptor(this, this.directSocketListener, HybridConnectionListener.HybridConnectionSocketType.Direct);
            this.connectionQueue      = new InputQueue <HybridConnection>();
            this.connectionTable      = new Dictionary <Guid, HybridConnection>();
        }
 public DemuxSocketElement(IConnectionElement innerElement, string type, DemuxSocketManager demuxManager)
 {
     this.innerElement = innerElement;
     this.type         = type;
     this.demuxManager = demuxManager;
 }