globeTCP

TCP connections library

connect(ip, port, timeout)

Parameters:

  • ip (string).

  • port (number)

  • timeout (number)

Return:

  • number

Example Usage:

-- Connect to example.com on port 80
local connectionId = tcp.connect("example.com", 80, 5000)

sendBytes(connectionId, bytesTable)

Parameters:

  • connectionId (number).

  • bytesTable (table)

Return:

  • boolean

Example Usage:

receiveBytes(connectionId, timeout, size)

Parameters:

  • connectionId (number).

  • timeout (number)

  • size (number)

Return:

  • table

Example Usage:

disconnect(connectionId)

Parameters:

  • connectionId (number).

Return:

  • boolean

Example Usage:

Last updated