renoise.Socket.SocketBase

SocketBase is the base class for socket clients and servers. All SocketBase properties and functions are available for servers and clients.


Properties

is_open : boolean

READ-ONLY Returns true when the socket object is valid and connected. Sockets can manually be closed (see socket:close()). Client sockets can also actively be closed/refused by the server. In this case the client:receive() calls will fail and return an error.

local_address : string

READ-ONLY The socket's resolved local address (for example "127.0.0.1" when a socket is bound to "localhost")

local_port : integer

READ-ONLY The socket's local port number, as specified when instantiated.


Functions

close(self)

Closes the socket connection and releases all resources. This will make the socket useless, so any properties, calls to the socket will result in errors. Can be useful to explicitly release a connection without waiting for the dead object to be garbage collected, or if you want to actively refuse a connection.