HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/fehQlibs-23/man/timeoutconn.3
.TH qlibs: timeoutconn 3
.SH NAME
timeoutconn \- set up an outoing stream socket for IPv4/IPv6
.SH SYNTAX
.B #include \(dqtimeoutconn.h\(dq

int \fBtimeoutconn4\fP(int \fIs\fR,char \fIip[4]\fR,uint16 \fIp\fR,unsigned int \fIt\fR);
.br
int \fBtimeoutconn6\fP(int \fIs\fR,char \fIip[16]\fR,uint16 \fIp\fR,unsigned int \fIt\fR,uint32 \fInetif\fR);
.br
int \fBtimeoutconn\fP(int \fIs\fR,char \fIip[16]\fR,uint16 \fIp\fR,unsigned int \fIt\fR,uint32 \fInetif\fR);
.SH DESCRITPION
.B timeoutconn
tries to establish a TCP stream socket to address
.I ip
on remoteport
.I p
and waiting for
.I t
seconds and on success returns the
.I s
socket identifier.

In case 
.I addresss 
is an IPv6 LLU address, one needs to define the
.I netif
interface index, otherwise 
.I 0
is the default.
.SH INTERNALS
.B timeoutconn
depends on 
.B taia
and
.B iopuase
to determine the timespan and perhaps
.B ndelay
to succeed.
.SH RETURN CODES
.B timeoutconn
returns
.I 0
if the connection is established
and 
.I -1
if an error has occured. 
.SH SEE ALSO
socket_if(3),
timeout(3)
taia(3),
wait(3)