ngraziano / SharpRTSP

A RTSP handling library
Other
519 stars 181 forks source link

Android Port Conflict (.NET issue) #74

Open belveder79 opened 2 years ago

belveder79 commented 2 years ago

I just tried using the library on an Android device, and I realized that the SocketException is not thrown even if the UDP port is already used:

https://github.com/ngraziano/SharpRTSP/blob/a42acb1d27ebebb3e08b6739acbc8e3f5942709d/RTSP/UdpSocket.cs#L47

Don't ask me why... I did not find any reference or similar issue anywhere. I just worked around it by specifying two different port ranges for audio and video here (respectively offsetting the audio port range by two from 50000 to 50002 works also):

https://github.com/ngraziano/SharpRTSP/blob/a42acb1d27ebebb3e08b6739acbc8e3f5942709d/RtspClientExample/RTSPClient.cs#L174