Esempio n. 1
0
 public CommClient(ICommClientImpl callbacks, string localsecret) : base(callbacks)
 {
     Pipe = new NamedPipeClientStream(
         ".", PIPENAME, PipeDirection.InOut,
         PipeOptions.Asynchronous);
     SetPipe(Pipe);
     this.callbacks = callbacks;
     connectevent   = new ManualResetEvent(false);
     connecting     = true;
     try
     {
         Pipe.Connect(2000);
         SetupReader();
         SendMessage(Communicator.CONNECT, localsecret);
         connectevent.WaitOne();
     }
     catch (Exception e)
     {
         Debug.Print("CLIENT constructor failure: " + e.ToString());
         throw;
     }
 }
 public CommClient(ICommClientImpl callbacks, string localsecret)
     : base(callbacks)
 {
     Pipe = new NamedPipeClientStream(
         ".", PIPENAME, PipeDirection.InOut,
         PipeOptions.Asynchronous);
     SetPipe(Pipe);
     this.callbacks = callbacks;
     connectevent = new ManualResetEvent(false);
     connecting = true;
     try
     {
         Pipe.Connect(2000);
         SetupReader();
         SendMessage(Communicator.CONNECT, localsecret);
         connectevent.WaitOne();
     }
     catch (Exception e)
     {
         Debug.Print("CLIENT constructor failure: " +e.ToString());
         throw;
     }
 }