Network Module
See also: Socket class. #Network Events

Due to the asynchronous nature of networking, a lot of networking information will only be available through the event system. For example, when a socket receives data, a new event will be pushed that contains the socket ID and the contents of the message.

Relevant events are:

For a full description of of these events, see the Events page. The important thing to remember is that the socketconnected event will push a new socket object while other socket events will only push a socket ID. As such, you should be sure to save the new socket object (preferably into a table) if your script will be accepting new connections.

#network.socket socket network.socket() socket network.socket(string connectionType)

Create a new socket object. This object will be used to actually open a connection and transmit data. Accepts only one string which determines the protocol type: "tcp" or "udp"; defaults to TCP if not given.

See the Socket class page for details on methods.

Page last updated at 2018-09-25 20:48:17


Copyright 2018