Skip to content

class TCPSocketServer

  • supers: TCPSocketMaster

😱 Types incomplete or incorrect? 🙏 Please contribute!


methods


TCPSocketServer.accept


function TCPSocketServer.accept()
 ->  TCPSocketClient?
 ->  ("timeout"|string)

Waits for a remote connection on the server object and returns a client object representing that connection.

If a connection is successfully initiated, a client object is returned. If a timeout condition is met, the method returns nil followed by the error string 'timeout'. Other errors are reported by nil followed by a message describing the error.

Note: calling socket.select with a server object in the recvt parameter before a call to accept does not guarantee accept will return immediately. Use the settimeout method or accept might block until another client shows up.

TCPSocketServer.getoption


function TCPSocketServer.getoption(option: TCPOption)
 ->  any?
 ->  string?

@return - The option value in case of success, or nil followed by an error message otherwise.

😱 Types incomplete or incorrect? 🙏 Please contribute!

@return - The option value in case of success, or nil followed by an error message otherwise.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Gets options for the TCP object. See setoption for description of the option names and values.

TCPSocketServer.setoption


function TCPSocketServer.setoption(
  option: TCPOption,
  value: any
)
 ->  1?
 ->  string?
@param option - A string with the option name

@param value - Depends on the option being set

@return - 1 on success, nil and an error message otherwise.

😱 Types incomplete or incorrect? 🙏 Please contribute!

@return - 1 on success, nil and an error message otherwise.

😱 Types incomplete or incorrect? 🙏 Please contribute!

Sets options for the TCP object. Options are only needed by low-level or time-critical applications. You should only modify an option if you are sure you need it.