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

#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) ;
}