protected internal override void OnNewPipe(Pipe pipe) { // Pair socket can only be connected to a single peer. // The socket rejects any further connection requests. if (m_pipe == null) m_pipe = pipe; else pipe.Close(false); }
private void AttachPipe(Pipe pipe) { // First, register the pipe so that we can terminate it later on. m_pipes.Add(pipe); pipe.PipeClosed += PipeClosed; pipe.WriteActivated += WriteActivated; pipe.ReadActivated += ReadActivated; pipe.Hiccuped += Hiccuped; // Let the protocol know about new pipe. m_protocol.OnNewPipe(pipe); // If the socket is already being closed, ask any new pipes to terminate // straight away. if (IsClosing) { RegisterCloseAcks(1); pipe.Close(false); } }