Skip to content

Commit 00fb464

Browse files
committed
DontRoute optional
now DontRoute option is optional
1 parent 505e76c commit 00fb464

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

LiteNetLib/NetManager.Socket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ private bool BindSocket(Socket socket, IPEndPoint ep)
405405
{
406406
socket.ExclusiveAddressUse = !ReuseAddress;
407407
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, ReuseAddress);
408-
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontRoute, true);
408+
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontRoute, DontRoute);
409409
}
410410
catch
411411
{

LiteNetLib/NetManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ private struct IncomingData
261261
/// </summary>
262262
public bool ReuseAddress = false;
263263

264+
/// <summary>
265+
/// UDP Only Socket Option
266+
/// Normally IP sockets send packets of data through routers and gateways until they reach the final destination.
267+
/// If the DontRoute flag is set to True, then data will be delivered on the local subnet only.
268+
/// </summary>
269+
public bool DontRoute = false;
270+
264271
/// <summary>
265272
/// Statistics of all connections
266273
/// </summary>

0 commit comments

Comments
 (0)