NetworkClientFactory initialization causes exception on some platforms
See original GitHub issueDescribe the bug
On some platforms, Initializing Socket.Buffer to 0 causes the following exception:
RtspClientSharp.Rtsp.RtspClientException: Connection error ---> System.ArgumentException: Value does not fall within the expected range.
Commenting out the referenced line seems to fix the issue. Currently, this is line 15 of NetworkClientFactory.cs.
This may be related to the implementation of System.Net.Sockets.Socket in the .NET equivalent in the Apple ecosystem. This issue does not occur on Windows.
To Reproduce This occurred in a project which integrates RtspClientSharp in Unity. It ran without issue on Windows, but failed on Mac and in a build for tvOS.
- Place the code into a Unity project
- Wrap the code in a MonoBehavior
- Press play and run the MonoBehavior
(Please note the above steps are already completed in this test repo I made for this issue)
When the initialization runs an exception will be thrown and should be caught in the Debug log.
Expected behavior Successfully initialize the socket and continue with program execution
- Device: MacBook Air, build also attempted for Apple TV
- OS: macOS Mojave 10.14.5, tvOS 12.3
- Browser N/A
- RtspClientSharp v1.2.8
- Unity 2018, Unity 2019
Additional context Unity on Mac uses Mono, and states it is “.NET 4.5 equivalent” - I am unsure if this is related.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Hello,
Thank you for report. I should add some checks for platform before modifying send buffer size.
This was ok for me!