Manpage logo

timeoutconn - set up an outoing stream socket for IPv4/IPv6

NAME  SYNTAX  DESCRITPION  INTERNALS  RETURN CODES  SEE ALSO 

NAME

timeoutconn − set up an outoing stream socket for IPv4/IPv6

SYNTAX

#include "timeoutconn.h"

int timeoutconn4(int s,char ip[4],uint16 p,unsigned int t);
int timeoutconn6(int s,char ip[16],uint16 p,unsigned int t,uint32 netif);
int timeoutconn(int s,char ip[16],uint16 p,unsigned int t,uint32 netif);

DESCRITPION

timeoutconn tries to establish a TCP stream socket to address ip on remoteport p and waiting for t seconds and on success returns the s socket identifier.

In case addresss is an IPv6 LLU address, one needs to define the netif interface index, otherwise 0 is the default.

INTERNALS

timeoutconn depends on taia and iopuase to determine the timespan and perhaps ndelay to succeed.

RETURN CODES

timeoutconn returns 0 if the connection is established and -1 if an error has occured.

SEE ALSO

socket_if(3), timeout(3) taia(3), wait(3)


Updated 2026-06-01 - jenkler.se | uex.se