Ejemplo n.º 1
0
        public virtual void Start()
        {
            readStream  = CreateReadStream();
            writeStream = CreateWriteStream();
            protocol    = new PipeProtocol(readStream, writeStream);

            StartReceived();
        }
Ejemplo n.º 2
0
 public virtual void Stop()
 {
     stopWait    = new System.Threading.ManualResetEvent(false);
     IsReceiving = false;
     stopWait.WaitOne(TimeSpan.FromSeconds(5));
     if (receiveThread != null && (receiveThread.ThreadState & ThreadState.Running) == ThreadState.Running)
     {
         try
         {
             receiveThread.Abort();
         }
         catch { }
     }
     if (writeStream != null)
     {
         writeStream.Dispose();
     }
     if (readStream != null)
     {
         readStream.Dispose();
     }
     protocol = null;
 }