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 b0b061e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ static int raw_connect_internal(struct trilogy_sock *sock, const struct addrinfo
return TRILOGY_SYSERR;
}

#ifdef TCP_NODELAY
if (sock->addr->ai_family != PF_UNIX) {
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 b0b061e

Please sign in to comment.