[Top]
Stdio
Stdio.File
|
Method Stdio.File()->connect()
- Method
connect
int Stdio.File()->connect(string host, int port, void|string client, void|int client_port)
- Description
-
This function connects a socket previously created with
Stdio.File.open_socket to a remote socket through TCP/IP. The
host argument is the hostname or IP number of the remote machine.
A local IP and port can be explicitly bound by specifying client
and client_port.
- Returns
This function returns 1 for success, 0 otherwise.
- Note
In nonblocking mode 0 (zero) may be returned and Stdio.File.errno set to
EWOULDBLOCK or WSAEWOULDBLOCK. 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()
|