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

Connection Problem with Python server with UE4 Client

Open talal0047 opened this issue 4 years ago • 9 comments

I want to create a simple connection with the server made using flask and an unreal client. The thing is that my python server run just fine as if I connect using a client written in python then they just connect perfectly. But my Ue4 client don't connect with my python server. Below is the python server I have written using flask_socketio

image

Another thing I must add is that the ue4 client just connect fine with node.js server. So, the connection problem is only with python server. I will attach the code of node server also.

image

below are the setting of Ue4 I am using.

image If anything more is required regarding this kindly let me know.

Thank you any kind of help would be appreciated.

talal0047 avatar Mar 27 '21 11:03 talal0047

Have you tried connecting with to socket.io server? I haven't heard of flask_socketio, but it may not work as advertised.

MichaelJCole avatar Mar 27 '21 15:03 MichaelJCole

Have you tried connecting with to socket.io server? I haven't heard of flask_socketio, but it may not work as advertised.

Yep I tried that also, same results with that, the test python would connect to it but the Ue4 client would not connect to the python server

talal0047 avatar Mar 27 '21 17:03 talal0047

@talal0047 That's not what I asked. Did you get Ue4 to connect to a node Socket.io server? You may need help from the flask_socketio project instead.

MichaelJCole avatar Mar 27 '21 17:03 MichaelJCole

@talal0047 That's not what I asked. Did you get Ue4 to connect to a node Socket.io server? You may need help from the flask_socketio project instead.

oh my mistake, yep I was able to connect to node.js socket.io server from ue4 socket.io client but was not able to connect to python socket.io server

talal0047 avatar Mar 27 '21 20:03 talal0047

Do you know what version of socket.io protocol the python server uses? It may be related to https://github.com/getnamo/socketio-client-ue4/issues/245 (and now v4 support...)

getnamo avatar Mar 28 '21 21:03 getnamo

I'm not sure if this is the same issue, but I am upgrading a project from 4.25 (with Socket IO Client 1.4.0) to 4.26, and I cannot get the client to work in 4.26. I, too, use a Python Socket.io server (python-socketio version 4.3.1). However, in my case the 4.25 project works fine with the server, while the 4.26 project does not (same server version). On 4.26 I have tried both the 1.5.5 version from the marketplace and the 1.6.0 available on GitHub. These are the log messages that both generate in Unreal:

SocketIO: SocketIO Connected with session: dbafd50ea72c4246a258b2a5e1084dd9
SocketIO: SocketIO dbafd50ea72c4246a258b2a5e1084dd9 connected to namespace: /
SocketIO: SocketIO Disconnected dbafd50ea72c4246a258b2a5e1084dd9 reason: CLOSE_REASON_NORMAL
SocketIO: SocketIO dbafd50ea72c4246a258b2a5e1084dd9 disconnected from namespace: /
SocketIO: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 5000
SocketIO: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 5000

On the server it looks like the client connects and then immediately disconnects.

ndbs-tsb avatar Sep 12 '22 06:09 ndbs-tsb

See https://github.com/getnamo/SocketIOClient-Unreal#socketio-server-compatibility. Check your server protocol version

getnamo avatar Sep 12 '22 06:09 getnamo

See https://github.com/getnamo/SocketIOClient-Unreal#socketio-server-compatibility. Check your server protocol version

Thanks. I have now tried upgrading my python-socketio server to 5.7.1 which should support 3.x/4.x, but I'm getting the exact same behaviour. Also, I would have expected version 1.5.5 to work with the other server version.

ndbs-tsb avatar Sep 12 '22 07:09 ndbs-tsb

See https://github.com/getnamo/SocketIOClient-Unreal#socketio-server-compatibility. Check your server protocol version

Thanks. I have now tried upgrading my python-socketio server to 5.7.1 which should support 3.x/4.x, but I'm getting the exact same behaviour. Also, I would have expected version 1.5.5 to work with the other server version.

A quick follow-up: this works with the JS reference implementation of socket.io, so I have to conclude that there is something amiss in the Python implementation.

ndbs-tsb avatar Sep 30 '22 14:09 ndbs-tsb