SocketIOClient-Unreal icon indicating copy to clipboard operation
SocketIOClient-Unreal copied to clipboard

Socket disconnects automatically after 1 minut aprox.

Open jgallegor opened this issue 2 years ago • 6 comments

When I connect successfully to my SocketIO Server, after a minute it disconnects automatically, showing the following message:

SocketIO: SocketIO Disconnected 3gNM4gQ3pQfe3pvrAAAa reason: CLOSE_REASON_NORMAL

My Server isn't closing the connection itself, so I don't know why it is being closed alone.

This is a screenshot of my SocketIO component configuration if it helps. image

Any idea?

jgallegor avatar Jun 29 '23 10:06 jgallegor

plugin version? platform? what type of server are you running on the other side? (nodejs? python?)

getnamo avatar Jul 05 '23 18:07 getnamo

Plugin version 2.6.0. Server runnning the Socket IO is a nodejs server with the socketio version compatible with plugin.

jgallegor avatar Jul 07 '23 14:07 jgallegor

Are you sending binary data? Does the chat example server work for you without disconnecting https://github.com/getnamo/SocketIOClient-Unreal-Example/releases work?

Come to think of it 1min time out sounds like GC interval, how are you creating your component/storing/referencing it in blueprint?

getnamo avatar Jul 07 '23 15:07 getnamo

Just tried the chat example and works fine, but this example uses http from socket.io module, and my server is using server.io. It seems an issue produced by the option of the Server of socket.io "connectTimeout" (The number of ms before disconnecting a client that has not successfully joined a namespace).

Chat example isn't using this option in the Client neither controlling namespace in the Server side.

jgallegor avatar Jul 11 '23 10:07 jgallegor

Sounds like you just need to join a namespace which is supported https://github.com/getnamo/SocketIOClient-Unreal#namespaces

getnamo avatar Jul 11 '23 15:07 getnamo

But if no namespace is specified, it will automatically join namespace '/', which is also the default namespace in the server if not specified (which is my case). So this would have to work, right? Or am I missing something?

jgallegor avatar Jul 12 '23 09:07 jgallegor