System.ServiceModel.Http2Protocol.Http2Protocol.CloseInternal C# (CSharp) Method

CloseInternal() private method

Closes connection to the remote host.
private CloseInternal ( StatusCode reason, int lastSeenStreamId, bool sendGoAway ) : void
reason StatusCode
lastSeenStreamId int
sendGoAway bool
return void
        private void CloseInternal(StatusCode reason, int lastSeenStreamId, bool sendGoAway)
        {
            if (this.opened)
            {
                this.opened = false;

                if (sendGoAway)
                    SendGoAway(lastSeenStreamId, reason);

                if (this.OnClose != null)
                {
                    this.OnClose(this, new CloseFrameEventArgs(new CloseFrameExt() { LastGoodSessionId = lastSeenStreamId, StatusCode = (int)reason }));
                }

                this.socket.Close();
                this.serializer.Dispose();
            }
        }