23 ArgumentNullException.ThrowIfNull(platformIdentifier);
26 using var socket =
new Socket(
28 ? AddressFamily.InterNetworkV6
29 : AddressFamily.InterNetwork,
37 socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse,
true);
38 socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress,
false);
40 socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger,
true);
43 socket.DualMode =
true;