@ -418,6 +418,13 @@ void keep_sockalive(int fd)
setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl));
}
void nolinger_socket(int fd)
{
const struct linger so_linger = { 1, 0 };
setsockopt(fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(so_linger));
void noblock_socket(int fd)
int flags = fcntl(fd, F_GETFL, 0);
@ -413,6 +413,7 @@ static inline bool sock_timeout(void)
bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port);
void keep_sockalive(int fd);
void nolinger_socket(int fd);
void noblock_socket(int fd);
void block_socket(int fd);
void _Close(int *fd);