This function is used to create a new client socket for your game to communicate over the network. You must define the socket protocol (see the list of constants below) and give a port to use, and the function will return a unique id which should be used in all further function calls for that socket, or a value of less than 0 if the connection fails.
| Constant | Description |
|---|---|
| network_socket_tcp | Create a socket using TCP. |
| network_socket_udp | Create a socket using UDP. |
| network_socket_ws | Create a web socket (only for projects running on HTML5), using TCP. |
network_create_socket_ext(protocol, port);
| Argument | Description |
|---|---|
| protocol | The network protocol to use |
| port | The port to use |
Real
client = network_create_socket_ext(network_socket_udp, 6510);
The above code will create a new UDP socket on port 6510.