[Top]
predef::
Stdio
Stdio.File
|
Method Stdio.File()->open_socket()
- Method
open_socket
-
int(0..1) open_socket(int|void port, string|void addr)
- Method
open_socket
-
int open_socket(int|void port, string|void address)
- Description
-
This makes this file into a socket ready for connections. The reason
for this function is so that you can set the socket to nonblocking
or blocking (default is blocking) before you call connect() .
If you give a port number to this function, the socket will be
bound to this port locally before connecting anywhere. This is
only useful for some silly protocols like FTP. You may also
specify an address to bind to if your machine has many IP numbers.
- Returns
-
This function returns 1 for success, 0 otherwise.
- See also
-
connect() , set_nonblocking() , set_blocking()
|