Skip to content

Commit

Permalink
set tcpnodelay
Browse files Browse the repository at this point in the history
  • Loading branch information
shanth96 committed Sep 13, 2023
1 parent fe52d3b commit bdff9d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ static int raw_connect_internal(struct trilogy_sock *sock, const struct addrinfo
return TRILOGY_SYSERR;
}

#ifdef TCP_NODELAY
int flags = 1;
if (setsockopt(sock->fd, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags)) < 0) {
goto fail;
}
#endif
if (sock->base.opts.keepalive_enabled) {
int flags = 1;
if (setsockopt(sock->fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&flags, sizeof(flags)) < 0) {
Expand Down

0 comments on commit bdff9d1

Please sign in to comment.