This function removes a network socket connection from your game and frees any memory associated with the socket. As such you must use this function when you no longer need a socket, otherwise unfreed sockets, as with any dynamic resource, will result in memory leaks.
network_destroy(socket);
| Argument | Type | Description |
|---|---|---|
| socket | Network Socket ID | The id of the socket to remove. |
N/A
if (!os_is_network_connected())
{
network_destroy(sock);
}
The above code will check to see if there is a data connection and if none is found, destroy the socket with the id "sock".