mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-30 13:13:44 +00:00
Set QoS flag for UDP forwarding
This commit is contained in:
@@ -147,6 +147,10 @@ int create_and_bind(const char *addr, const char *port)
|
||||
LOGI("tcp port reuse enabled");
|
||||
}
|
||||
|
||||
// Set QoS flag
|
||||
int tos = 46;
|
||||
setsockopt(remotefd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))
|
||||
|
||||
s = bind(listen_sock, rp->ai_addr, rp->ai_addrlen);
|
||||
if (s == 0) {
|
||||
/* We managed to bind successfully! */
|
||||
@@ -643,6 +647,10 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
setsockopt(remotefd, SOL_TCP, TCP_KEEPINTVL, (void *)&keepInterval, sizeof(keepInterval));
|
||||
setsockopt(remotefd, SOL_TCP, TCP_KEEPCNT, (void *)&keepCount, sizeof(keepCount));
|
||||
|
||||
// Set QoS flag
|
||||
int tos = 46;
|
||||
setsockopt(remotefd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos))
|
||||
|
||||
// Set non blocking
|
||||
setnonblocking(remotefd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user