HTML5 Web Sockets Not Connecting in GM2.3

orbian

Member
Has something changed with web sockets in GM2.3? The following code works fine in GM2.2 when I connect to a Node.js server running wss on port 9999:

GML:
    socketID = network_create_socket(network_socket_ws);
    if (socketID >= 0)
    {
        if (global.wss == true)
        {
            show_debug_message("Connecting with wss");
            wss_str = "wss://" + global.serverAddress;
            show_debug_message(wss_str + ":" + string(global.serverPort));
        
            i = network_connect_raw( socketID, wss_str, global.serverPort );
        }
        else
        {
            show_debug_message("Connecting with ws");
            i = network_connect_raw( socketID, global.serverAddress , global.serverPort );
        }
    
        show_debug_message("ClientID:" + string(i));
    }
    else
    {
        show_debug_message("socketID:" + string(socketID));
    }
However in GM2.3 I get the following error:
Error: function network_connect_raw()

No other information is provided. in GM2.2 it would connect without any issues.

Thanks.
 

rwkay

YoYo Games Staff
YYG Staff
You need to use the network_connect_raw_async() rather than network_connect_raw() as HTML5 does not allow us to have blocking calls for network connect.

Russell
 
Top