Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"connect_error" Messages Aren't Passed Through to Unreal Engine Client #427

Open
BillSempsrott opened this issue Jun 3, 2024 · 0 comments

Comments

@BillSempsrott
Copy link

Socket.io servers emit a "connect_error" event whenever there is a connection failure.

For example, connection middleware functions can be used to add functionality to the connection process (for authentication, logging, etc.). If a middleware function has a problem, it can fail by returning an error, in which case the connection attempt will fail.

Here is an example of a server code snippet where the middleware function fails and returns an error:

io.use((socket, next) => {
    // Problem with authentication...return an error
    next(new Error("ERROR_AUTHENTICATION_INVALID"));
});

The above code will cause the server to emit a "connect_error" message. In the Socket.io Javascript client, "connect_error" messages can be received as follows:

socket.on("connect_error", (error) => {
    console.log(error.message);
});

"connect_error" messages are not currently passed all the way through by the Unreal Engine client. They do, however, make it through to the underlying Socket.io protocol wrapper classes. In sio_socket.cpp, for example, these messages are received in the on_message_packet function, where they are identified as packet::type_error (see screenshot).

image

It would be great if the plugin could pass the "connect_error" messages through to the SocketIONative class via a new callback called "OnConnectError" or equivalent, as this would allow users of the Unreal Engine client to respond properly to connection errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants