All Functions Modules Pages
socket

Functions

SOCKET socket.connect (STRING url, NUMBER port)
 Opens a socket using the adress and ports indicated. More...
 
NUMBER socket.send (SOCKET zock, STRING data)
 Send data through the socket. More...
 
NUMBER socket.send (SOCKET zock, STRING data, NUMBER size)
 Send data through the socket. More...
 
STRING socket.recv (SOCKET zock, NUMBER size)
 Receive data through the socket. More...
 
NIL socket.close (SOCKET zock)
 Close the socket. More...
 

Detailed Description

Internet connection using sockets.

Function Documentation

SOCKET socket.connect ( STRING  url,
NUMBER  port 
)

Opens a socket using the adress and ports indicated.

Parameters
urlServer adress.
portPort to use for connect.
Returns
Socket object type, ready to use.
NUMBER socket.send ( SOCKET  zock,
STRING  data 
)

Send data through the socket.

Parameters
zockAn opened socket.
dataData to send.
Returns
Number of sent bytes.
NUMBER socket.send ( SOCKET  zock,
STRING  data,
NUMBER  size 
)

Send data through the socket.

Parameters
zockAn opened socket.
dataData to send.
sizeSize of the data to send.
Returns
Number of sent bytes.
STRING socket.recv ( SOCKET  zock,
NUMBER  size 
)

Receive data through the socket.

Parameters
zockAn opened socket.
sizeSize 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
zockSocket to be closed.
Returns
Nothing.