network_connect_raw

Connect to a server.

Syntax:

network_connect_raw(socket, url, port);


Argument Description
socket The id of the socket to use.
url The URL or IP to connect to (a string).
port The port to connect to.


Returns: Real


Description

With this function you can send a request to connect to a server. The function takes the socket id to connect through (see network_create_socket) and requires you to give the IP address to connect to (a string) as well as the port to connect through, and if the connection fails a value of less than 0 will be returned. The difference between this function and network_connect is that this function can connect to any server and does nothing to the raw data, meaning that you have to implement the protocols yourself at the server end.


Example:

client = network_create_socket(network_socket_tcp);
network_connect_raw(client, "www.macsweeneygames.com", 6510);

The above code will create a new TCP socket then attempt to create a "raw" connection through that to the given URL on port 6510.


Back: Networking
Next: network_resolve
© Copyright YoYo Games Ltd. 2018 All Rights Reserved