CSharpRTMP.Core.Protocols.Rtsp.RtspProtocol.PushResponseFirstLine C# (CSharp) Method

PushResponseFirstLine() public method

public PushResponseFirstLine ( string version, uint code, string reason ) : void
version string
code uint
reason string
return void
        public void PushResponseFirstLine(string version, uint code, string reason)
        {
            _responseHeaders[RTSP_FIRST_LINE, RTSP_VERSION] = version;
            _responseHeaders[RTSP_FIRST_LINE, RTSP_STATUS_CODE] = code;
            _responseHeaders[RTSP_FIRST_LINE, RTSP_STATUS_CODE_REASON] = reason;
        }

Usage Example

        private bool SendAuthenticationChallenge(RtspProtocol from, Variant realm)
        {
            //10. Ok, the user doesn't know that this needs authentication. We
            //will respond back with a nice 401. Generate the line first
            string wwwAuthenticate = HTTPAuthHelper.GetWWWAuthenticateHeader(
                    realm["method"],
                    realm["name"]);

            //12. Save the nonce for later validation when new requests are coming in again
            from.CustomParameters["wwwAuthenticate"] = wwwAuthenticate;

            //13. send the response
            from.PushResponseFirstLine(RTSP_VERSION_1_0, 401, "Unauthorized");
            from.PushResponseHeader(HTTP_HEADERS_WWWAUTHENTICATE, wwwAuthenticate);
            return from.SendResponseMessage();
        }
All Usage Examples Of CSharpRTMP.Core.Protocols.Rtsp.RtspProtocol::PushResponseFirstLine