ReservePorts() public method

public ReservePorts ( ) : void
return void
コード例 #1
0
ファイル: RTPManager.cs プロジェクト: Dawn2Yuan/sipsorcery
        public RTPManager(bool includeAudio, bool includeVideo)
        {
            if (includeAudio)
            {
                // Create a UDP socket to use for sending and receiving RTP audio packets.
                _rtpAudioChannel = new RTPChannel();
                _rtpAudioChannel.SetFrameType(FrameTypesEnum.Audio);
                _rtpAudioChannel.ReservePorts(DEFAULT_START_RTP_PORT, DEFAULT_END_RTP_PORT);
                _rtpAudioChannel.OnFrameReady += AudioFrameReady;
            }

            if (includeVideo)
            {
                _rtpVideoChannel = new RTPChannel();
                _rtpVideoChannel.SetFrameType(FrameTypesEnum.VP8);
                _rtpVideoChannel.ReservePorts(DEFAULT_START_RTP_PORT, DEFAULT_END_RTP_PORT);
                _rtpVideoChannel.OnFrameReady += VideoFrameReady;
                _rtpVideoChannel.OnRTPSocketDisconnected += () => { };
            }
        }