network_create_socket_ext(protocol, port);

参数 描述
protocol 所使用的网络协议
port 待使用的端口

返回: Real(实数)


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.

常量 描述
network_socket_tcp 使用TCP协议创建一个网络套接字。
network_socket_udp 使用UDP协议创建一个网络套接字。


client = network_create_socket_ext(network_socket_udp, 6510);

The above code will create a new UDP socket on port 6510.