TransportListener(BaseUriWithWildcard pipeUri)
        {
            if (TD.PipeTransportListenerListeningStartIsEnabled())
            {
                TD.PipeTransportListenerListeningStart(this.EventTraceActivity, (pipeUri.BaseAddress != null) ? pipeUri.BaseAddress.ToString() : string.Empty);
            }

            transportType = TransportType.NamedPipe;
            IConnectionListener connectionListener = new PipeConnectionListener(pipeUri.BaseAddress, pipeUri.HostNameComparisonMode,
                ListenerConstants.SharedConnectionBufferSize, null, false, int.MaxValue);
            demuxer = Go(connectionListener);

            if (TD.PipeTransportListenerListeningStopIsEnabled())
            {
                TD.PipeTransportListenerListeningStop(this.EventTraceActivity);
            }
        }
 public PendingAccept(PipeConnectionListener listener, PipeHandle pipeHandle, bool isBoundToCompletionPort, AsyncCallback callback, object state) : base(callback, state)
 {
     this.pipeHandle              = pipeHandle;
     this.result                  = pipeHandle;
     this.listener                = listener;
     this.onAcceptComplete        = new OverlappedIOCompleteCallback(this.OnAcceptComplete);
     this.overlapped              = new OverlappedContext();
     this.isBoundToCompletionPort = isBoundToCompletionPort;
     if (!Thread.CurrentThread.IsThreadPoolThread)
     {
         if (onStartAccept == null)
         {
             onStartAccept = new Action <object>(PipeConnectionListener.PendingAccept.OnStartAccept);
         }
         ActionItem.Schedule(onStartAccept, this);
     }
     else
     {
         this.StartAccept(true);
     }
 }
 public PendingAccept(PipeConnectionListener listener, PipeHandle pipeHandle, bool isBoundToCompletionPort, AsyncCallback callback, object state) : base(callback, state)
 {
     this.pipeHandle = pipeHandle;
     this.result = pipeHandle;
     this.listener = listener;
     this.onAcceptComplete = new OverlappedIOCompleteCallback(this.OnAcceptComplete);
     this.overlapped = new OverlappedContext();
     this.isBoundToCompletionPort = isBoundToCompletionPort;
     if (!Thread.CurrentThread.IsThreadPoolThread)
     {
         if (onStartAccept == null)
         {
             onStartAccept = new Action<object>(PipeConnectionListener.PendingAccept.OnStartAccept);
         }
         ActionItem.Schedule(onStartAccept, this);
     }
     else
     {
         this.StartAccept(true);
     }
 }
Пример #4
0
            public unsafe PendingAccept(PipeConnectionListener listener, PipeHandle pipeHandle, bool isBoundToCompletionPort,
                AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.pipeHandle = pipeHandle;
                this.result = pipeHandle;
                this.listener = listener;
                onAcceptComplete = new OverlappedIOCompleteCallback(OnAcceptComplete);
                overlapped = new OverlappedContext();
                this.isBoundToCompletionPort = isBoundToCompletionPort;

                if (TD.PipeConnectionAcceptStartIsEnabled())
                {
                    this.eventTraceActivity = new EventTraceActivity();
                    TD.PipeConnectionAcceptStart(this.eventTraceActivity, this.listener.pipeUri != null ? this.listener.pipeUri.ToString() : string.Empty);
                }

                if (!Thread.CurrentThread.IsThreadPoolThread)
                {
                    if (onStartAccept == null)
                    {
                        onStartAccept = new Action<object>(OnStartAccept);
                    }
                    ActionItem.Schedule(onStartAccept, this);
                }
                else
                {
                    StartAccept(true);
                }
            }