renoise.Socket

Interfaces for built-in socket support for Lua scripts in Renoise.

Right now UDP and TCP protocols are supported. The class interfaces for UDP and TCP sockets behave exactly the same. That is, they don't depend on the protocol, so both are easily interchangeable when needed.

Constants

Protocol

{
    PROTOCOL_TCP: integer = 1,
    PROTOCOL_UDP: integer = 2,
}

Functions

create_client(server_address : string, server_port : integer, protocol : renoise.Socket.Protocol?, timeout : integer?)

->client : renoise.Socket.SocketClient?, error : string?

Create a connected UPD or TCP client. protocol can be renoise.Socket.PROTOCOL_TCP or renoise.Socket.PROTOCOL_UDP (by default TCP). timeout is the time in ms to wait until the connection is established (1000 ms by default). When instantiation and connection succeed, a valid client object is returned, otherwise "error" is set and the client object is nil

create_server(server_address : string, server_port : integer, protocol : renoise.Socket.Protocol?)

->renoise.Socket.SocketServer?, string?

Creates a connected UPD or TCP server object. Use "localhost" to use your system's default network address. Protocol can be renoise.Socket.PROTOCOL_TCP or renoise.Socket.PROTOCOL_UDP (by default TCP). When instantiation and connection succeed, a valid server object is returned, otherwise "error" is set and the server object is nil. Using the create function with no server_address allows you to create a server which allows connections to any address (for example localhost and some IP)