代码适用于断点,没有断点

时间:2014-08-28 06:12:35

标签: sockets breakpoints rtsp rtp

我正在使用Manged Media Aggregation开源https://net7mma.codeplex.com/来实现连接到VLC Rtsp服务器的RtspClient。

问题是 - 当我正常运行代码时 - 我有异常说客户端无法从Describe响应中获取会话描述(即使我可以看到我在wireshark中完美地获得它)。

当我放置断点 - 并进入StartListening()方法和开源代码中的其他方法时 - 它工作正常,我得到RTP流。

以下是代码:

public partial class Form1 : Form
{

    RtspClient client;

    public Form1()
    {
        InitializeComponent();
        AccessWithClient();
    }

    private void AccessWithClient()
    {
        client = new RtspClient("rtsp://192.168.30.11:5544/stream",RtspClient.ClientProtocolType.Udp);
        client.OnConnect += client_OnConnect;
        client.Connect();

    }

    void client_OnConnect(RtspClient sender, object args)
    {
        // Tried to increase the timeout, but didn't solve it

        sender.Timeout = new TimeSpan(ushort.MaxValue);
        sender.SocketReadTimeout = ushort.MaxValue;
        sender.StartListening();
    }

}

关于它为什么不起作用的任何想法?

提前致谢

0 个答案:

没有答案
相关问题