Create a new client socket.


GML Code Example


Argument Description
type The type of socket connection to create (see the constants listed below).

Returns: Real


This function is used to create a new client socket for your game to communicate over the network. You must define the socket type (see the list of constants below) and the function will return a unique id for that socket, which should be used in all further function calls for that socket, or a value of less than 0 if the connection fails.

NOTE: You can use the IP "" to connect back to the same device that is running the game.

Constant Description
network_socket_tcp Create a web socket using TCP.
network_socket_udp Create a web socket using UDP.
network_socket_bluetooth Create a bluetooth socket (currently unavailable!).


GML Code Example

client = network_create_socket(network_socket_tcp);
 network_connect( client, “”, 6510 );

The above code will create a new TCP socket then attempt to connect through that to the given IP address on port 6510.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here