Method Stdio.Fd()->connect()
- Method connect
boolconnect(stringdest_addr,intdest_port)
boolconnect(stringdest_addr,intdest_port,stringsrc_addr,intsrc_port)
string(8bit)|int(0..0)connect(stringdest_addr,intdest_port,string|int(0..0)src_addr,int|int(0..0)src_port,string(8bit)data)- Description
Open a TCP/IP connection to the specified destination.
In nonblocking mode, success is indicated with the write-callback, and failure with the close-callback or the read_oob-callback.
If the
dataargument is included the socket will use TCP_FAST_OPEN if available, if not the data will not be sent. In the data case the function either returns the data that has not been sent (only one packet can be sent with this option) or 0 if the connection failed immediately.- Returns
Returns
1or the remainingdataon success, and0on failure.- Note
In nonblocking mode
0(zero) may be returned and errno() set to EWOULDBLOCK or WSAEWOULDBLOCK. This should not be regarded as a connection failure.