Content:
- Methods

NetClients can be used to communicate with servers on the web.

net = app.CreateNetClient( type ) → app object: NetClient

You can choose between two different protocols:
The connection based TransmissionControlProtocol which always checks if the data was received correctly and in right order. It is used in most cases because it is very reliable. The downside is that it is relatively slow becaus of the numerous checks.
The connectionless UserDatagramProtocol which sends the data once without any checks so that packages may be corrupt or lost completely during the transmission. Because of that data can be sent as fast as possible and it suits perfectly for games which need a fast update rate between the devices.


Note: A few routers block fast UDP messages by default

Example - TCP Basic click to expand contents 

Example - TCP AutoReceive click to expand contents 

Example - UDP Messaging click to expand contents 

Methods

The following methods are available on the NetClient object:

Close()
GetBroadcastAddress() → String
GetType() → String: “NetClient”
IsEnabled() → Boolean
ReceiveBytes( mode ) → List: [ bytes ]
ReceiveFile( file, wait ) → String
ReceiveText( mode ) → String
ReceiveVideoStream( port, img ) → String