Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIO_UDP_CONNRESET: prevent exception throwing on unsupported platforms #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
SIO_UDP_CONNRESET: prevent exception throwing on unsupported platforms
  • Loading branch information
Grandbrain committed May 14, 2020
commit 8ee4da0f0fcd8f20517701d7cf155d32a328996f
16 changes: 13 additions & 3 deletions RtspClientSharp/Utils/NetworkClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Net.Sockets;
using System;
using System.Net.Sockets;

namespace RtspClientSharp.Utils
{
Expand Down Expand Up @@ -27,8 +28,17 @@ public static Socket CreateUdpClient()
ReceiveBufferSize = UdpReceiveBufferDefaultSize,
DualMode = true
};
socket.IOControl((IOControlCode)SIO_UDP_CONNRESET, EmptyOptionInValue, null);

try
{
socket.IOControl((IOControlCode)SIO_UDP_CONNRESET, EmptyOptionInValue, null);
}
catch (PlatformNotSupportedException)
{

}

return socket;
}
}
}
}