Skip to content

Commit 1fade5b

Browse files
Modify NetSocket to support Nintendo Switch
Wrapping the "Ttl = NetConstants.SocketTTL;" line in a platform scripting symbol makes this whole library work on Nintendo Switch in DOTS + IL2CPP projects.
1 parent e4c94b4 commit 1fade5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LiteNetLib/NetSocket.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ private bool BindSocket(Socket socket, IPEndPoint ep, bool reuseAddress, IPv6Mod
280280
}
281281
if (socket.AddressFamily == AddressFamily.InterNetwork)
282282
{
283+
#if !UNITY_SWITCH
283284
Ttl = NetConstants.SocketTTL;
284-
285+
#endif
285286
#if NETSTANDARD || NETCOREAPP
286287
if(!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
287288
#endif

0 commit comments

Comments
 (0)