Enable DSCP tagging in addition to using SO_NET_SERVICE_TYPE on macOS/iOS

It appears SO_NET_SERVICE_TYPE doesn't always enable DSCP tagging, so let's do it manually too.
This commit is contained in:
Cameron Gutman
2024-02-01 18:24:53 -06:00
parent a339bf51c8
commit a92d6960a6
+1 -2
View File
@@ -455,7 +455,7 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
// iOS/macOS
value = value ? NET_SERVICE_TYPE_VO : NET_SERVICE_TYPE_BE;
result = setsockopt (socket, SOL_SOCKET, SO_NET_SERVICE_TYPE, (char *) & value, sizeof (int));
#else
#endif
#ifdef IP_TOS
// UNIX - IPv4
value = value ? 46 << 2 : 0; // DSCP: Expedited Forwarding
@@ -471,7 +471,6 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
value = value ? 6 : 0; // Max priority without NET_CAP_ADMIN
result = setsockopt (socket, SOL_SOCKET, SO_PRIORITY, (char *) & value, sizeof (int));
#endif
#endif /* SO_NET_SERVICE_TYPE */
break;
case ENET_SOCKOPT_TTL: