Announcement

Collapse
No announcement yet.

[Plugin] Socket.io Client

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

    Hey there,

    I´m trying to store some profilepictures with a nodejs socket.io server into a mongodb database.
    I tried a lot of stuff but unfortunately I can´t get it workin'.

    I attached 3 screenshots.
    One from inside of UE,
    one of the saved "<Binary Data>" inside the mongo db database..
    and the last one shows the "<Binary Data>" printed from the nodejs server after getting it from the datatable..
    But when I get the binary data within unreal it´s emtpy.. Is this any known bug? - or am I doing anything wrong?

    Thanks in advance for any help <3!

    Comment


      Originally posted by Mad_Toni View Post
      Hey there,

      I´m trying to store some profilepictures with a nodejs socket.io server into a mongodb database.
      I tried a lot of stuff but unfortunately I can´t get it workin'.

      I attached 3 screenshots.
      One from inside of UE,
      one of the saved "<Binary Data>" inside the mongo db database..
      and the last one shows the "<Binary Data>" printed from the nodejs server after getting it from the datatable..
      But when I get the binary data within unreal it´s emtpy.. Is this any known bug? - or am I doing anything wrong?

      Thanks in advance for any help <3!
      I just checked the latest version of the plugin against a binary roundtrip test and it still works as expected. I don't see your node.js logic in the pictures, without that I can only make assumptions. It looks like you're trying to get the field 'avatar' when your json has the binary data under 'useravatar' so it could be getting the wrong field which is why it would be empty... Otherwise the blueprints look correct at a glance. You might consider using emitWithCallback if you're trying to fetch some information from the server which would obviate the need to bind and emit another event for receiving the data.
      Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

      Comment


        I am running into big issues and I do not know how to solve it.

        My UE 4.22 (UE 4.22-Oculus build from source) project, using the latest version of this plugin, running in Mac, disconnects the socket unexpectedly and is then no longer able to reconnect properly. I'm using manual connect and I'm *not* using a Plugin Scoped connection. Basically my projects send approx. 10 messages per 'tick'. With a slow tick internal, like one tick every second, it's stable and there are no problems. When I have the tick interbal on 0.1 second (so approx. 100 messages per second) it soon disconnects and cannot reconnect again. I see this in the log:

        ...
        SocketIOLog: SocketIO eKjVnNjoMd2x6eRHAAAB appears to have lost connection, reconnecting attempt 0 with delay 5000
        ...

        It then looks like it is rebuilding the connection. First to the default namespace and then to the namespace I was using. And the I get the same message 'lost connection' message again.

        First of all I'm worried about the initial disconnect and the consecutive disconnects (after reconnect).

        I'm using a node.js server with socket.io version 2.2.0.

        Any ideas why this is happening?

        What's the C++ Socket IO client version that is being used? There may be a version mismatch. I have seen some reports about socket.io that indicate that you should make sure version is on par with server version.

        Any help is appreciated.
        Last edited by iambeeblebrox42; 05-09-2019, 02:45 AM.

        Comment


          Hi,

          anybody can give me a hint how to get dynamic "rooms" for clients to join? (via room-ids)
          Server-Side its something like this:

          Code:
          // attach Socket.io to our HTTP server
          io = socketio.listen(server);
          
          // handle incoming connections from clients
          io.sockets.on('connection', function(socket) {
              // once a client has connected, we expect to get a ping from them saying what room they want to join
              socket.on('room', function(room) {
                  socket.join(room);
              });
          });
          
          // now, it's easy to send a message to just the clients in a given room
          room = "abc123";
          io.sockets.in(room).emit('message', 'what is going on, party people?');
          
          // this message will NOT go to the client defined above
          io.sockets.in('foobar').emit('message', 'anyone in this room yet?');
          but how to do the client-side via Blueprints?
          Client-Side:

          Code:
           // set-up a connection between the client and the server
          var socket = io.connect();  
          // let's assume that the client page, once rendered, knows what room it wants to join
          var room = "abc123";  
          socket.on('connect', function() {    
          // Connected, let's sign-up for to receive messages for this room    
          socket.emit('room', room); });  
          socket.on('message', function(data) {    
          console.log('Incoming message:', data); });
          Thanks in advance for help :-)

          Comment


            Is it possible just to use this for JSON-RPC calls, or its not really in scope of this plugin?

            Comment

            Working...
            X