Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# RTSP Socks协议无效响应_C#_Rtsp - Fatal编程技术网

C# RTSP Socks协议无效响应

C# RTSP Socks协议无效响应,c#,rtsp,C#,Rtsp,使用Socks协议获取RTSP descripe选项的响应时遇到问题。我得到的回应是关于选项,而不是描述。 例如,我遵循wiki选项,descripe、SETUP、PLAY、TEARDOWN、GET_参数、SET_参数,几乎所有地方都有200个响应,而不是descripe 实施情况如下: StreamUtils.WriteLine(bufferedNetStream, stringBuilder.ToString()); RtspResponse rtspResponse = this.Rece

使用Socks协议获取
RTSP descripe
选项的响应时遇到问题。我得到的回应是关于选项,而不是描述。 例如,我遵循wiki选项,descripe、SETUP、PLAY、TEARDOWN、GET_参数、SET_参数,几乎所有地方都有200个响应,而不是
descripe

实施情况如下:

StreamUtils.WriteLine(bufferedNetStream, stringBuilder.ToString());
RtspResponse rtspResponse = this.ReceiveResponse(bufferedNetStream);
这是缓冲流的读取实现:

public BufferedNetStream(TcpSocket sock, bool ownsSocket)
    {
        this.m_Socket = sock;
        this.m_ownsSocket = ownsSocket;
    }

    public override void Write(byte[] buffer, int offset, int count)
    {
        try
        {
            this.m_Socket.Send(buffer, offset, count);
        }
        catch (Exception exception)
        {
            this.lastExcept = exception;
        }
    }

    public static void WriteLine(Stream stream, string line)
    {
        byte[] bytes = Encoding.Default.GetBytes(string.Concat(line, "\r\n"));
        stream.Write(bytes, 0, (int)bytes.Length);
        stream.Flush();
        stream.Seek(0, SeekOrigin.Begin);
    }

    public override int Read(byte[] buffer, int offset, int size)
    {
        int num;
        this.lastExcept = null;
        if (this.dataBuffer != null)
        {
            int num1 = Math.Min(size, (int)this.dataBuffer.Length - this.dataOffset);
            Array.Copy(this.dataBuffer, this.dataOffset, buffer, offset, num1);
            offset += num1;
            this.dataOffset += num1;
            while (num1 < size)
            {
                this.dataBuffer = this.m_Socket.ReceivePacket();
                if (this.m_Socket.LastException != null)
                {
                    string stackTrace = this.m_Socket.LastException.StackTrace;
                    this.lastExcept = this.m_Socket.LastException;
                    num = num1;
                    return num;
                }
                else if (this.dataBuffer != null)
                {
                    this.dataOffset = 0;
                    if ((int)this.dataBuffer.Length != 0)
                    {
                        int num2 = Math.Min(size - num1, (int)this.dataBuffer.Length - this.dataOffset);
                        Array.Copy(this.dataBuffer, 0, buffer, offset, num2);
                        num1 += num2;
                        offset += num2;
                        this.dataOffset += num2;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    num = num1;
                    return num;
                }
            }
            num = num1;
        }
        else
        {
            num = 0;
        }
        return num;
    }
public-BufferedNetStream(TcpSocket-sock,bool-ownsSocket)
{
这个m_插座=袜子;
this.m_ownsocket=ownsocket;
}
公共重写无效写入(字节[]缓冲区、整数偏移量、整数计数)
{
尝试
{
此.m_Socket.Send(缓冲区、偏移量、计数);
}
捕获(异常)
{
this.lastException=异常;
}
}
公共静态void WriteLine(流、字符串行)
{
byte[]bytes=Encoding.Default.GetBytes(string.Concat(第行“\r\n”);
stream.Write(字节,0,(int)字节.长度);
stream.Flush();
stream.Seek(0,SeekOrigin.Begin);
}
公共重写整型读取(字节[]缓冲区,整型偏移量,整型大小)
{
int-num;
this.lastException=null;
如果(this.dataBuffer!=null)
{
int num1=Math.Min(大小,(int)this.dataBuffer.Length-this.dataOffset);
Copy(this.dataBuffer,this.dataOffset,buffer,offset,num1);
偏移量+=num1;
this.dataOffset+=num1;
while(num1<大小)
{
this.dataBuffer=this.m_Socket.ReceivePacket();
if(this.m_Socket.LastException!=null)
{
string stackTrace=this.m_Socket.LastException.stackTrace;
this.LastException=this.m_Socket.LastException;
num=num1;
返回num;
}
else if(this.dataBuffer!=null)
{
this.dataOffset=0;
如果((int)this.dataBuffer.Length!=0)
{
int num2=Math.Min(size-num1,(int)this.dataBuffer.Length-this.dataOffset);
Copy(this.dataBuffer,0,buffer,offset,num2);
num1+=num2;
偏移量+=num2;
这个.dataOffset+=num2;
}
其他的
{
打破
}
}
其他的
{
num=num1;
返回num;
}
}
num=num1;
}
其他的
{
num=0;
}
返回num;
}