/// <summary> /// Посылает запрос через tcpClient и получает ответ /// </summary> /// <param name="request">Посылаемый запрос</param> /// <param name="tcpClient">Соединение, с помощью которого нужно послать запрос</param> /// <returns>RTSP-ответ, завернутый в класс RTSPResponse</returns> public static RTSPResponse Get(RTSPRequest request, TcpClient tcpClient) { string req = request.ToString(); string response = Send(req, tcpClient); return(RTSPResponse.Parse(response)); }
private RTSPResponse Send(RTSPRequest request) { RTSPResponse resp = RTSPResponse.Get(request, tcpClient); CSeq++; if (resp.StatusCode != 200) { throw new Exception("RTSPResponse " + resp.StatusCode); } else { return(resp); } }
public void Teardown() { if (tcpClient == null) { return; } string localPath = uri.LocalPath; if (localPath[localPath.Length - 1] != '/') { localPath += '/'; } Send(RTSPRequest.CreateTeardown(String.Format("rtsp://{0}{1}", uri.DnsSafeHost, localPath), CSeq, this.Parameters.Session)); }
private RTSPResponse Send(RTSPRequest request) { RTSPResponse resp = RTSPResponse.Get(request, tcpClient); CSeq++; if (resp.StatusCode != 200) { throw new Exception("RTSPResponse " + resp.StatusCode); } else { return resp; } }
/// <summary> /// Посылает запрос через tcpClient и получает ответ /// </summary> /// <param name="request">Посылаемый запрос</param> /// <param name="tcpClient">Соединение, с помощью которого нужно послать запрос</param> /// <returns>RTSP-ответ, завернутый в класс RTSPResponse</returns> public static RTSPResponse Get(RTSPRequest request, TcpClient tcpClient) { string req = request.ToString(); string response = Send(req, tcpClient); return RTSPResponse.Parse(response); }
public RTSPResponse Play(string session) { return(Send(RTSPRequest.CreatePlay(uri.AbsoluteUri, CSeq, session))); }
public RTSPResponse Setup(string url, int RTPClientPort, int RTCPClientPort, string session = "") { return(Send(RTSPRequest.CreateSetup(url, CSeq, RTPClientPort, RTCPClientPort, session))); }
public RTSPResponse Describe() { return(Send(RTSPRequest.CreateDescribe(uri.AbsoluteUri, CSeq))); }
public RTSPResponse Options() { return(Send(RTSPRequest.CreateOptions(uri.AbsoluteUri, CSeq))); }