net_connect(addr,port,serve,udp)

From ENIGMA

Revision as of 20:49, 4 June 2013 by IsmAvatar (Talk | contribs)
Jump to: navigation, search

Description

Initializes a socket as either a client or socket as UDP or TCP-IP using the given network address and port. Supports both IPv4 and IPv6, for clients the identifier indicates the server used for receiving messages. Returns an indentifier for the socket or negative on error.

Parameters

Parameter Description
addr string containing network address
port string containing network port
serve boolean whether or not the socket is a server (true) or client (false)
udp boolean whether or not the connection is udp

Return Values

integer: Returns the id of the socket or negative on error.

Example Call

// demonstrates opening a udp network connection
cid = net_connect("111.1.1.1", "100", false, true);
Personal tools
Namespaces
Variants
Actions
Navigation
ENIGMA
Other
Toolbox