Announcement

Collapse
No announcement yet.

[Plugin] Socket.io Client

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Hello,

    I'm trying to implement this plugin with a python server also using socketio. I'm able to connect to the server and emit a message but when a try to receive from the server, UE keep crashing.

    I haven't been able to find a solution to my problem.


    Click image for larger version

Name:	console_result.JPG
Views:	1
Size:	16.2 KB
ID:	1543239

    Error in UE editor :
    Click image for larger version

Name:	Error_socketio_project.JPG
Views:	1
Size:	19.8 KB
ID:	1543234



    Log file
    Click image for larger version

Name:	Log_file_error_socketio_project_2.JPG
Views:	1
Size:	475.2 KB
ID:	1543235





    As I understand it, I couldn't bind an event. I couldn't find why...


    Here is my server code (python 3.7)

    Code:
    from aiohttp import web
    import socketio
    from colorama import init, Fore
    init(autoreset=True)
    
    sio = socketio.AsyncServer()
    app = web.Application()
    sio.attach(app)
    #sio.manager.set_server
    
    
    async def index(request):
       with open('index.html') as f:
         return web.Response(text=f.read(), content_type='text/html')
    
    @sio.on('connect', namespace="/")
    def connect(sid, env):
        print(Fore.RED + "connect ", sid)
    
    @sio.on('test', namespace="/")
    async def message(sid, data):
        print(Fore.GREEN + "message << ", data)
        await sio.emit('reply', "Hi i'm the server", sid)
    
    @sio.on('disconnect', namespace="/")
    def disconnect(sid):
        print(Fore.RED + 'disconnect', sid)
    
    #app.router.add_static('/static', 'static')
    app.router.add_get('/', index)
    
    
    if __name__ == '__main__':
        web.run_app(app)

    Blueprints
    Click image for larger version

Name:	Bp_socketio_project_1.JPG
Views:	2
Size:	204.5 KB
ID:	1543237

    Click image for larger version

Name:	Bp_socketio_project_2.JPG
Views:	1
Size:	125.9 KB
ID:	1543238


    Does anyone have an idea on how to solve this?

    Thank you,
    Attached Files

    Comment


      Originally posted by MagikarpWithATie View Post
      Hello,

      I'm trying to implement this plugin with a python server also using socketio. I'm able to connect to the server and emit a message but when a try to receive from the server, UE keep crashing.

      I haven't been able to find a solution to my problem.


      ...

      Does anyone have an idea on how to solve this?

      Thank you,
      It looks like your reply is an array (["Hi i'm the server", sid])

      Code:
      await sio.emit('reply', "Hi i'm the server", sid)
      out of curiosity does it crash if you remove the last variable?

      Code:
      await sio.emit('reply', "Hi i'm the server")
      have you tried embedding the sid response in an array? e.g.

      Code:
      await sio.emit('reply', ["Hi i'm the server", str(sid]))
      It may be that the function AsString is failing in detecting array SIOJsonValues. I've opened an issue on the plugin here: https://github.com/getnamo/socketio-...ue4/issues/102 for this problem, feel free to continue the discussion there.
      Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

      Comment


        Hi, this plugin need some any extra install?
        Installed from marketplace, tryed the client sample, but not connetcting to server, don't get any error.
        Tryed from pc and android too. The server is run by another phone (work because can connect, send data with another client app).
        Ip and port is good.
        Created exe, added to firewall exception, still not work.
        Packaged to android phone (android 7), not connect to the server.
        4.20.3 UE version.

        Any idea?

        Comment


          Originally posted by Hermyth View Post
          Hi, this plugin need some any extra install?
          Installed from marketplace, tryed the client sample, but not connetcting to server, don't get any error.
          Tryed from pc and android too. The server is run by another phone (work because can connect, send data with another client app).
          Ip and port is good.
          Created exe, added to firewall exception, still not work.
          Packaged to android phone (android 7), not connect to the server.
          4.20.3 UE version.

          Any idea?
          Android is not yet supported, only windows and linux. Also make sure you're using http not https. See https://github.com/getnamo/socketio-client-ue4-example for example documentation.
          Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

          Comment

          Working...
          X