summaryrefslogtreecommitdiff
path: root/src/libstddjb/socket_timeoutconn.c
blob: 3288426b61c3aa27137f1cea5b275985ab1693bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <stdint.h>
#include <skalibs/tai.h>
#include <skalibs/socket.h>

int socket_timeoutconn (int s, char const *ip, uint16_t port, unsigned int timeout)
{
  tain_t stamp, deadline ;
  tain_now(&stamp) ;
  tain_addsec(&deadline, &stamp, timeout) ;
  return socket_deadlineconnstamp4(s, ip, port, &deadline, &stamp) ;
}