G
Gomango999
Guest
I have a simple client and server set up going on. The client will attempt to connect to the server in the step event. However, I've found that if the client fails to connect to the server on the first try (e.g. I turn the server program off), it will never be able to connect to the server even when I turn the server program back on. This applies also when I bind the server_connect_raw() function to the space bar. The code for the client is below:
Client Create Event:
Client Step Event:
Client Create Event:
Code:
network_set_config(network_config_connect_timeout,1000);
sock = network_create_socket(network_socket_tcp);
server = -1;
send_buff = buffer_create( 256, buffer_grow, 1);
toPrint = "" //toPrint gets printed out in the draw event in the top left of my screen
Code:
if (server < 0) {
//Try to connect to server
server = network_connect_raw(sock, "192.168.1.111" , 6510);
if (server < 0) {
if (toPrint == "") toPrint = "Connecting";
toPrint +="."
if (toPrint == "Connecting.....") toPrint = "Connecting";
} else toPrint = "Connected!";
}
Last edited by a moderator: