Method Stdio.File()->connect()
- Method
connect
intconnect(stringhost,int|stringport,void|stringclient,void|int|stringclient_port)- Description
This function connects a socket previously created with open_socket() to a remote socket through TCP/IP. The
hostargument is the hostname or IP number of the remote machine. A local IP and port can be explicitly bound by specifyingclientandclient_port.- Returns
This function returns 1 for success, 0 otherwise.
- Note
In nonblocking mode
0(zero) may be returned and errno() set toEWOULDBLOCKorWSAEWOULDBLOCK. This should not be regarded as a connection failure. In nonblocking mode you need to wait for a write or close callback before you know if the connection failed or not.- See also
query_address(), async_connect(), connect_unix()