From bc6281ee63a39842b9f7e0c89dda3a2357ed0d4a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Mon, 15 Feb 2021 20:53:07 +0100 Subject: [PATCH] Add MTU option. --- Source/Engine/Platform/Base/NetworkBase.h | 2 ++ Source/Engine/Platform/Win32/Win32Network.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/Source/Engine/Platform/Base/NetworkBase.h b/Source/Engine/Platform/Base/NetworkBase.h index 90195c729..0ae8a3dcc 100644 --- a/Source/Engine/Platform/Base/NetworkBase.h +++ b/Source/Engine/Platform/Base/NetworkBase.h @@ -76,6 +76,8 @@ enum class FLAXENGINE_API NetworkSocketOption NoDelay, /// Enables IPv6 communication only for TCP socket. IPv6Only, + /// Retrieve the current path MTU, the socket must be connected UDP/TCP. + Mtu }; struct FLAXENGINE_API NetworkSocketState diff --git a/Source/Engine/Platform/Win32/Win32Network.cpp b/Source/Engine/Platform/Win32/Win32Network.cpp index cea22dacb..38b99a25e 100644 --- a/Source/Engine/Platform/Win32/Win32Network.cpp +++ b/Source/Engine/Platform/Win32/Win32Network.cpp @@ -132,6 +132,7 @@ static void TranslateSockOptToNative(NetworkSocketOption option, int32* level, i SOCKOPT(NetworkSocketOption::Error, SOL_SOCKET, SO_ERROR) SOCKOPT(NetworkSocketOption::NoDelay, IPPROTO_TCP, TCP_NODELAY) SOCKOPT(NetworkSocketOption::IPv6Only, IPPROTO_IPV6, IPV6_V6ONLY) + SOCKOPT(NetworkSocketOption::Mtu, IPPROTO_IP , IP_MTU) } }