Ejemplo n.º 1
0
 public void Stop()
 {
     m_Server.WaitForPipeDrain();
     m_Server.Close();
     m_Client.Close();
     m_Client.Dispose();
     m_Client = null;
     m_Server.Dispose();
     m_Server = null;
 }
Ejemplo n.º 2
0
 public void Close()
 {
     if (!_disposed)
     {
         lock (this)
             if (!_disposed)
             {
                 _server.WaitForPipeDrain();
                 _server.Dispose();
                 _client.Dispose();
                 _disposed = true;
             }
     }
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     Logger.LogInfo($"Client {_pipeRead?.SafePipeHandle.DangerousGetHandle().ToInt32()}-{_pipeWrite?.SafePipeHandle.DangerousGetHandle().ToInt32()} disposing");
     _pipeRead?.Dispose();
     _pipeWrite.Dispose();
     Logger.Flush();
 }
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         _inServer?.Dispose();
         _outServer?.Dispose();
         _inClient?.Dispose();
         _outClient?.Dispose();
     }
 }
Ejemplo n.º 5
0
        public static void ClientReadOnlyDisconnectedPipeThrows()
        {
            using (AnonymousPipeServerStream server = new AnonymousPipeServerStream(PipeDirection.Out))
                using (AnonymousPipeClientStream client = new AnonymousPipeClientStream(PipeDirection.In, server.ClientSafePipeHandle))
                {
                    client.Dispose();

                    OtherSidePipeDisconnectWriteThrows(server);
                }
        }
 /// <summary>
 /// Sends a goodbye message (a zero byte) and closes this side of the pipe.
 /// </summary>
 public void Dispose()
 {
     if (!_disposed)
     {
         _disposed = true;
         _client.WriteByte(0);
         _writer.Dispose();
         _client.Dispose();
     }
 }
 public void Dispose()
 {
     _writer.WriteLine("GOODBYE");
     if (OperatingSystem.IsWindows())
     {
         _client.WaitForPipeDrain();
     }
     _writer.Dispose();
     _client.Dispose();
 }
Ejemplo n.º 8
0
 public void Dispose()
 {
     if (!_disposed)
     {
         lock (this)
             if (!_disposed)
             {
                 _server.Dispose();
                 _client.Dispose();
                 _disposed = true;
             }
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// This does the actual work of changing the status and shutting down any threads we may have for
        /// disconnection.
        /// </summary>
        private void InternalDisconnect()
        {
            ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
            _terminatePacketPump.Set();
            _packetPump.Join();
#if CLR2COMPATIBILITY
            _terminatePacketPump.Close();
#else
            _terminatePacketPump.Dispose();
#endif
#if FEATURE_NAMED_PIPES_FULL_DUPLEX
            _pipeServer.Dispose();
#else
            _pipeClientToServer.Dispose();
            _pipeServerToClient.Dispose();
#endif
            _packetPump = null;
            ChangeLinkStatus(LinkStatus.Inactive);
        }
Ejemplo n.º 10
0
 public void Dispose()
 {
     _in.Dispose();
     _out.Dispose();
 }
Ejemplo n.º 11
0
 public void Dispose()
 {
     clientStream?.Dispose();
 }
Ejemplo n.º 12
0
 public void Dispose()
 {
     pipeServer?.Dispose();
     pipeClient?.Dispose();
 }
Ejemplo n.º 13
0
        public static void ClientReadOnlyDisconnectedPipeThrows()
        {
            using (AnonymousPipeServerStream server = new AnonymousPipeServerStream(PipeDirection.Out))
            using (AnonymousPipeClientStream client = new AnonymousPipeClientStream(PipeDirection.In, server.ClientSafePipeHandle))
            {
                client.Dispose();

                OtherSidePipeDisconnectWriteThrows(server);
            }
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Dispose all used resources
 /// </summary>
 public void Dispose()
 {
     client.Dispose();
     input.Dispose();
     output.Dispose();
 }
Ejemplo n.º 15
0
 override public void Dispose()
 {
     base.Dispose();
     PipeToServer.Dispose();
     PipeFromServer.Dispose();
 }
Ejemplo n.º 16
0
 public void ClosePipe()
 {
     _client.Close();
     _client.Dispose();
     _client = null;
 }