SIPSorcery.Net.RTSPSession.SendRTPRaw C# (CSharp) Méthode

SendRTPRaw() public méthode

Sends a packet to the RTSP server on the RTP socket.
public SendRTPRaw ( byte payload ) : void
payload byte
Résultat void
        public void SendRTPRaw(byte[] payload)
        {
            try
            {
                if (!_closed && _rtpSocket != null && _remoteEndPoint != null && _rtpSocketError == SocketError.Success)
                {
                    //_rtpSocket.SendTo(payload, _remoteEndPoint);

                    //SocketAsyncEventArgs socketSendArgs = new SocketAsyncEventArgs();
                    //socketSendArgs.SetBuffer(payload, 0, payload.Length);
                    //socketSendArgs.RemoteEndPoint = _remoteEndPoint;
                    //_rtpSocket.SendToAsync(socketSendArgs);

                    _rtpSocket.BeginSendTo(payload, 0, payload.Length, SocketFlags.None, _remoteEndPoint, SendRtpCallback, _rtpSocket);
                }
            }
            catch (Exception excp)
            {
                if (!_closed)
                {
                    logger.Error("Exception RTSPSession.SendRTPRaw attempting to send to " + _remoteEndPoint + ". " + excp);

                    if (OnRTPSocketDisconnected != null)
                    {
                        OnRTPSocketDisconnected(_sessionID);
                    }
                }
            }
        }