Player APIs (BrightScript & Ja...
...
Networking Objects
roTCPServer
2 min
the javascript equivalent is net socket iftcpserverinstance getfailurereason() as string yields additional useful information if an rotcpserver method fails setport(port as object) sets the message port that will receive events from an rotcpserver instance bindtoport(port as dynamic) as boolean prepares to accept incoming tcp connections on the specified port passing an integer to this method will specify a standard port number this method can also accept an associative array to provide more control over the binding the associative array must contain the port but can also contain the interface name this method returns true upon success and false upon failure port integer integer the local port number to bind to interface integer integer or or string string either the name of a network interface as a string (such as "eth0" or "wlan0") or the integer associated with the network interface index 1 any (this is the default value) 0 ethernet 1 wifi 2 modem 32767 loopback (i e tcp connections can only be established by internal sources) ifuserdata setuserdata(a as object) supplies an object that will be provided by every event called by an rotcpserver instance getuserdata() as object returns the user data that has previously been set via setuserdata() it will return invalid if no data has been set