@@ -256,7 +256,7 @@ private void RTSPMessageReceived(object sender, RtspChunkEventArgs e)
256256 // Update the RTSP Keepalive Timeout
257257 lock ( _connectionList )
258258 {
259- foreach ( var oneConnection in _connectionList . Where ( c => c . Listener . RemoteAdress == listener . RemoteAdress ) )
259+ foreach ( var oneConnection in _connectionList . Where ( c => c . Listener . RemoteEndPoint . Address == listener . RemoteEndPoint . Address ) )
260260 {
261261 // found the connection
262262 oneConnection . UpdateKeepAlive ( ) ;
@@ -376,8 +376,8 @@ private void HandleSetup(RtspListener listener, RtspRequestSetup setupMessage)
376376 // RTP over UDP mode
377377 // Create a pair of UDP sockets - One is for the Data (eg Video/Audio), one is for the RTCP
378378 var udpPair = new UDPSocket ( 50000 , 51000 ) ; // give a range of 500 pairs (1000 addresses) to try incase some address are in use
379- udpPair . SetDataDestination ( listener . RemoteAdress . Split ( ':' ) [ 0 ] , transport . ClientPort . First ) ;
380- udpPair . SetControlDestination ( listener . RemoteAdress . Split ( ':' ) [ 0 ] , transport . ClientPort . Second ) ;
379+ udpPair . SetDataDestination ( listener . RemoteEndPoint . Address . ToString ( ) . Split ( ':' ) [ 0 ] , transport . ClientPort . First ) ;
380+ udpPair . SetControlDestination ( listener . RemoteEndPoint . Address . ToString ( ) . Split ( ':' ) [ 0 ] , transport . ClientPort . Second ) ;
381381 udpPair . ControlReceived += ( localSender , localE ) =>
382382 {
383383 // RTCP data received
@@ -424,7 +424,7 @@ private void HandleSetup(RtspListener listener, RtspRequestSetup setupMessage)
424424 string copyOfSessionId = "" ;
425425 lock ( _connectionList )
426426 {
427- foreach ( var setupConnection in _connectionList . Where ( connection => connection . Listener . RemoteAdress == listener . RemoteAdress ) )
427+ foreach ( var setupConnection in _connectionList . Where ( connection => connection . Listener . RemoteEndPoint . Address == listener . RemoteEndPoint . Address ) )
428428 {
429429 // Check the Track ID to determine if this is a SETUP for the Video Stream
430430 // or a SETUP for an Audio Stream.
@@ -658,7 +658,7 @@ public void SendRawRTP(RTSPConnection connection, RTPStream stream, List<Memory<
658658
659659 if ( writeError )
660660 {
661- _logger . LogWarning ( "Error writing to listener " + connection . Listener . RemoteAdress ) ;
661+ _logger . LogWarning ( "Error writing to listener " + connection . Listener . RemoteEndPoint . Address . ToString ( ) ) ;
662662 _logger . LogWarning ( "Removing session " + connection . SessionId + " due to write error" ) ;
663663 RemoveSession ( connection ) ;
664664 }
@@ -696,7 +696,7 @@ public bool SendRawRTCP(RTSPConnection connection, RTPStream stream, Span<byte>
696696 }
697697 catch ( Exception e )
698698 {
699- _logger . LogError ( e , "Error writing RTCP to listener {remoteAdress}" , connection . Listener . RemoteAdress ) ;
699+ _logger . LogError ( e , "Error writing RTCP to listener {remoteAdress}" , connection . Listener . RemoteEndPoint . Address . ToString ( ) ) ;
700700 return false ;
701701 }
702702 return true ;
0 commit comments