Internet connection using sockets.
| SOCKET socket.connect |
( |
STRING |
url, |
|
|
NUMBER |
port |
|
) |
| |
Opens a socket using the adress and ports indicated.
- Parameters
-
| url | Server adress. |
| port | Port to use for connect. |
- Returns
- Socket object type, ready to use.
| NUMBER socket.send |
( |
SOCKET |
zock, |
|
|
STRING |
data |
|
) |
| |
Send data through the socket.
- Parameters
-
| zock | An opened socket. |
| data | Data to send. |
- Returns
- Number of sent bytes.
| NUMBER socket.send |
( |
SOCKET |
zock, |
|
|
STRING |
data, |
|
|
NUMBER |
size |
|
) |
| |
Send data through the socket.
- Parameters
-
| zock | An opened socket. |
| data | Data to send. |
| size | Size of the data to send. |
- Returns
- Number of sent bytes.
| STRING socket.recv |
( |
SOCKET |
zock, |
|
|
NUMBER |
size |
|
) |
| |
Receive data through the socket.
- Parameters
-
| zock | An opened socket. |
| size | Size of the data for receive. It will receive 1024 bytes default if is omitted. |
- Returns
- Data received. Also, returns the number of bytes received (may not match the number of bytes requested).
| NIL socket.close |
( |
SOCKET |
zock | ) |
|
Close the socket.
- Parameters
-
- Returns
- Nothing.