User Tag List

Page 3 of 3 FirstFirst 123
Results 81 to 102 of 102

Thread: [Plugin] Socket.io Client

  1. #81
    0
    Update to 0.6.0
    Changes:

    API Changes:
    -Rebased to accomodate #43. You can now put FSocketIONative anywhere with your own allocation structure.
    -'On' event dispatch changed to 'OnEvent'.

    Fixes:
    -Candidate fixes for #41, #32, and #38
    -Fixes to underlying library stopping re connection attempts when you close a connection: getnamo/socket.io-client-cpp@3f0cd99

    You can find the latest release at https://github.com/getnamo/socketio-client-ue4/releases

    If you had crashes with 0.5.2 try 0.6.0 and let me know if that has resolved issues. You should be able to open maps in packaged games with components whether your server is up or not. The only potentially unhandled use case is when you open a map to a server that is up and you swap map after the server status changes (e.g. becomes unreachable/goes down). If you have this use case you can use the workaround of setting bAsyncQuitDisconnect to false in your components (https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Public/SocketIOClientComponent.h#L54) which will synchronize your disconnects. If you have a lot of components it will add about ~ 1sec per component delay.
    Last edited by getnamo; 05-07-2017 at 02:51 PM.

  2. #82
    0
    Infiltrator
    Join Date
    Mar 2015
    Posts
    11
    Reporting success with my experiments over here, so far.

    Are socket.io "rooms" available to use in this implementation? If so, I'd love to see a quick c++ example on how to listen to one.

    Thanks again getnamo! =)

  3. #83
    0
    Quote Originally Posted by edcolmar View Post
    Reporting success with my experiments over here, so far.

    Are socket.io "rooms" available to use in this implementation? If so, I'd love to see a quick c++ example on how to listen to one.

    Thanks again getnamo! =)
    You're welcome

    Namespaces are supported, it's the optional parameter called Namespace at the end of your function calls e.g Emit and OnEvent. Namespace support was added in 0.4.0, see the related closed issue: https://github.com/getnamo/socketio-client-ue4/issues/9. When you connect to a namespace, you'll get OnNamespaceConnectedCallback. This is all assuming FSocketIONative, the api is very similar for USocketIOClientComponent.
    Last edited by getnamo; 05-08-2017 at 01:43 PM.

  4. #84
    0
    @getnamo
    Thank you for putting out this fix so fast! I can confirm that my issues appear to be gone; the editor is no longer crashing nearly as much and switching levels in the packaged project appears to be working now. I still feel like I'm running into issue #44 though. I can switch from my first level where there are seven SocketIO components connected to my server, emit a message read by the server, read a response, and switch. When I switch, the components all disconnect and I can load the second level.

    However, when this second level finishes it switches back to the first one and crashes in the packaged project. It sends a lot of messages back and forth to the server and has about 11 SocketIO components. These are all showing as disconnected when I log it in the server, but the first level can't open up again. This error is only present in the packaged version. When I switch every component to disable asynchronous switching, this works properly in both the editor and the packaged game.

    Obviously, this can lead to some load times that are a lot longer than they need to be. Any idea why this is happening or how to fix it? I'm certain that the server is staying completely accessible the whole time.

  5. #85
    0
    Infiltrator
    Join Date
    Mar 2015
    Posts
    11
    Quote Originally Posted by getnamo View Post
    You're welcome

    Namespaces are supported, it's the optional parameter called Namespace at the end of your function calls e.g Emit and OnEvent. Namespace support was added in 0.4.0, see the related closed issue: https://github.com/getnamo/socketio-client-ue4/issues/9. When you connect to a namespace, you'll get OnNamespaceConnectedCallback. This is all assuming FSocketIONative, the api is very similar for USocketIOClientComponent.
    I believe "rooms" are different than namespaces. Some of the research I was doing yesterday suggested that namespaces are predefined, and rooms can be created dynamically.

    http://stackoverflow.com/questions/13143945/dynamic-namespaces-socket-io

    I was having issues trying to connect to namespaces which were not yet created, which makes sense if they must be pre-defined.

  6. #86
    0
    Quote Originally Posted by Rockhopper View Post
    @getnamo
    Thank you for putting out this fix so fast! I can confirm that my issues appear to be gone; the editor is no longer crashing nearly as much and switching levels in the packaged project appears to be working now. I still feel like I'm running into issue #44 though. I can switch from my first level where there are seven SocketIO components connected to my server, emit a message read by the server, read a response, and switch. When I switch, the components all disconnect and I can load the second level.

    However, when this second level finishes it switches back to the first one and crashes in the packaged project. It sends a lot of messages back and forth to the server and has about 11 SocketIO components. These are all showing as disconnected when I log it in the server, but the first level can't open up again. This error is only present in the packaged version. When I switch every component to disable asynchronous switching, this works properly in both the editor and the packaged game.

    Obviously, this can lead to some load times that are a lot longer than they need to be. Any idea why this is happening or how to fix it? I'm certain that the server is staying completely accessible the whole time.
    I think this is related to the fact that the components don't release all of their memory immediately in the asynchronous case. This then gets caught in UE4's CanaryFail (related but not the same issue: answerhub) which is meant to catch garbage collection memory leaks. My understanding is that the system is not aware that another thread will release the memory when it is complete thus considers this a leak. The solution here would be to have the allocation cycle on something that survives world/level transitions (stack? plugin?).

    For some reason the pooling of garbage collected objects are different in the editor vs packaged and this is why I think we're getting the situation we have.

    One potential solution I can think of is using plugin scoped memory allocation. I was experimenting with it earlier and there are some extra functions ready to try it out: https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Public/SocketIOClient.h#L36 but after I found a way to encapsulate the memory within the component I considered that cleaner and I didn't pursue it further. With the packaging bug it may be that plugin scoping the memory would be appropriate after all.
    Last edited by getnamo; 05-09-2017 at 02:26 PM.

  7. #87
    0
    Quote Originally Posted by edcolmar View Post
    I believe "rooms" are different than namespaces. Some of the research I was doing yesterday suggested that namespaces are predefined, and rooms can be created dynamically.

    http://stackoverflow.com/questions/13143945/dynamic-namespaces-socket-io

    I was having issues trying to connect to namespaces which were not yet created, which makes sense if they must be pre-defined.
    Glancing over the source api again, it doesn't look like the C++ client has anything setup for room use. Do you have javascript examples for socket.io client and server usage? Seeing this used in javascript could help inform how it's supposed to look like in C++.

    socket.io docs (#2) are as always a bit light on examples; looking at the docs though it seems to be a server only feature for grouping sockets.

    Some more resources:
    http://stackoverflow.com/questions/19150220/creating-rooms-in-socket-io - shows a client joining a room, but client api doesn't appear to have .join, or are the docs just outdated?
    Last edited by getnamo; 05-09-2017 at 02:21 PM.

  8. #88
    0
    Quote Originally Posted by getnamo View Post
    I think this is related to the fact that the components don't release all of their memory immediately in the asynchronous case. This then gets caught in UE4's CanaryFail (related but not the same issue: answerhub) which is meant to catch garbage collection memory leaks. My understanding is that the system is not aware that another thread will release the memory when it is complete thus considers this a leak. The solution here would be to have the allocation cycle on something that survives world/level transitions (stack? plugin?).

    For some reason the pooling of garbage collected objects are different in the editor vs packaged and this is why I think we're getting the situation we have.

    One potential solution I can think of is using plugin scoped memory allocation. I was experimenting with it earlier and there are some extra functions ready to try it out: https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Public/SocketIOClient.h#L36 but after I found a way to encapsulate the memory within the component I considered that cleaner and I didn't pursue it further. With the packaging bug it may be that plugin scoping the memory would be appropriate after all.
    Ah, that's really interesting. I'm working entirely with blueprints right now and would like to stick to working that way; do you think there's a way for me to make use of this package scoping?

  9. #89
    0
    Quote Originally Posted by Rockhopper View Post
    Ah, that's really interesting. I'm working entirely with blueprints right now and would like to stick to working that way; do you think there's a way for me to make use of this package scoping?
    I'll likely need to branch it and try a few things to see if it fixes it. Might be a bit before I get time for socketio plugin pass again. In meantime consider using the async disconnect toggle off.

    As always you can track the progress of the issue here: https://github.com/getnamo/socketio-client-ue4/issues/44

  10. #90
    0
    Hi there,

    so I've tried to get socket.io to work with my unreal project for actually several months now. And sometimes it kind of works but never really, so I very much hope that you guys can help me!

    I have UE 4.15.2. and socket.io v0.6.0, those should be the up-to-date versions.
    I've added the socket.io plugin directly to the engine, because when I added it to the project itself, the packaged project wouldn't even start.

    As long as I only connect to a socket.io client, everything still works fine. But once I try to emit an event, the editor freezes and crashes. It still emits the event though, because I can see that it works. If I package the project like that, it simply won't emit the event.
    So I don't know what to do here. Best would be, if wouldn't crash in the editor and if it would work in the packaged project. But I'm happy with everything just working in the packaged project, I can deal with a frozen editor.

    Thanks in advance!

  11. #91
    0
    Quote Originally Posted by pinkgoldpeach View Post
    Hi there,

    so I've tried to get socket.io to work with my unreal project for actually several months now. And sometimes it kind of works but never really, so I very much hope that you guys can help me!

    I have UE 4.15.2. and socket.io v0.6.0, those should be the up-to-date versions.
    I've added the socket.io plugin directly to the engine, because when I added it to the project itself, the packaged project wouldn't even start.

    As long as I only connect to a socket.io client, everything still works fine. But once I try to emit an event, the editor freezes and crashes. It still emits the event though, because I can see that it works. If I package the project like that, it simply won't emit the event.
    So I don't know what to do here. Best would be, if wouldn't crash in the editor and if it would work in the packaged project. But I'm happy with everything just working in the packaged project, I can deal with a frozen editor.

    Thanks in advance!
    What platform is this for? Windows is the only one that has functioning static libs atm. If it is windows, do you have a minimal reproducible project you can share or logs of the crash?
    v0.6.0 should be fairly solid and I haven't yet encountered what you describe so any info you can provide will greatly help.

  12. #92
    0
    Hi,

    thanks for the fast reply

    Yes it's for windows - win64. I'll make a small project and see if I can reproduce the error, but I can share some logs now!
    Since the crashes only happen, once I start emitting, I assume it has to do something with socket.io.


    [2017.05.18-17.00.15:922][887]LogWindows:Error: === Critical error: ===
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error: Assertion failed: false [File:C:\Program Files (x86)\Epic Games\4.15\Engine\Source\Runtime\Core\Public\Templates/Function.h] [Line: 268]
    [2017.05.18-17.00.15:922][887]LogWindows:Error: Attempting to call an unbound TFunction!
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error: KERNELBASE.dll!0x0000000002BB3C58
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CED864EE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEBACEEE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEB32729
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-SocketIOClient.dll!0x00000000A75AA7C9
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-SocketIOClient.dll!0x00000000A75B2E56
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA0D84D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA0DC6D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA2CCEB
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA2C912
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEC11233
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEB5A997
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA5ED4FF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9AB617D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B74F997D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7CEAA15
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B91817DF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B936CA4F
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9703254
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B970308B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B92E1F65
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8B0ADDC
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA55509A
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA687E6E
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6A9EC1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AC0C2
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA68887E
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6D1F73
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AC0C2
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA55509A
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AB43B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8AD3922
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9D67AF7
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8A92CDF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8A9FE2B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9BD5844
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B918D5F1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9BC30EE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B91AC0E3
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7998BA7
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B79C53AD
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B79E1834
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B74C626B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7CD2156
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7CDEE3
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7BEB40
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7BEBBA
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7D0A29
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7D22B6
    [2017.05.18-17.00.15:922][887]LogWindows:Error: KERNEL32.DLL!0x0000000003AC8364
    [2017.05.18-17.00.15:922][887]LogWindows:Error: ntdll.dll!0x00000000064E70D1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: ntdll.dll!0x00000000064E70D1
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:949][887]LogExit: Executing StaticShutdownAfterError
    [2017.05.18-17.00.16:321][887]LogWindows: FPlatformMisc::RequestExit(1)

  13. #93
    0
    Quote Originally Posted by pinkgoldpeach View Post
    Hi,

    thanks for the fast reply

    Yes it's for windows - win64. I'll make a small project and see if I can reproduce the error, but I can share some logs now!
    Since the crashes only happen, once I start emitting, I assume it has to do something with socket.io.


    [2017.05.18-17.00.15:922][887]LogWindows:Error: === Critical error: ===
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error: Assertion failed: false [File:C:\Program Files (x86)\Epic Games\4.15\Engine\Source\Runtime\Core\Public\Templates/Function.h] [Line: 268]
    [2017.05.18-17.00.15:922][887]LogWindows:Error: Attempting to call an unbound TFunction!
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:922][887]LogWindows:Error: KERNELBASE.dll!0x0000000002BB3C58
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CED864EE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEBACEEE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEB32729
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-SocketIOClient.dll!0x00000000A75AA7C9
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-SocketIOClient.dll!0x00000000A75B2E56
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA0D84D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA0DC6D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA2CCEB
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEA2C912
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEC11233
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Core.dll!0x00000000CEB5A997
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA5ED4FF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9AB617D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B74F997D
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7CEAA15
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B91817DF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B936CA4F
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9703254
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B970308B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B92E1F65
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8B0ADDC
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA55509A
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA687E6E
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6A9EC1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AC0C2
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA68887E
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6D1F73
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AC0C2
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA55509A
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-CoreUObject.dll!0x00000000DA6AB43B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8AD3922
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9D67AF7
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8A92CDF
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B8A9FE2B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9BD5844
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B918D5F1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B9BC30EE
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-Engine.dll!0x00000000B91AC0E3
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7998BA7
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B79C53AD
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B79E1834
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B74C626B
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor-UnrealEd.dll!0x00000000B7CD2156
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7CDEE3
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7BEB40
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7BEBBA
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7D0A29
    [2017.05.18-17.00.15:922][887]LogWindows:Error: UE4Editor.exe!0x000000005B7D22B6
    [2017.05.18-17.00.15:922][887]LogWindows:Error: KERNEL32.DLL!0x0000000003AC8364
    [2017.05.18-17.00.15:922][887]LogWindows:Error: ntdll.dll!0x00000000064E70D1
    [2017.05.18-17.00.15:922][887]LogWindows:Error: ntdll.dll!0x00000000064E70D1
    [2017.05.18-17.00.15:922][887]LogWindows:Error:
    [2017.05.18-17.00.15:949][887]LogExit: Executing StaticShutdownAfterError
    [2017.05.18-17.00.16:321][887]LogWindows: FPlatformMisc::RequestExit(1)
    I'll need more than this, looking forward to the example project. From the error though its pointing to an unbound function (I'm guessing some callback is null).

    Are you emitting in blueprint? if so are you emitting with callback or just regular emit? (consider showing your emit graph)

  14. #94
    0
    Hi

    so I just tried to add it to the first-person-example-project and the same happens. It crashes on emitting. I use a regular emit.
    I'll add a screenshot of the blueprint.
    Name:  socketio.PNG
Views: 154
Size:  205.6 KB

  15. #95
    0
    Something I forgot to say, I am not sure the connection is properly established.
    Because if I check if it is connected, it returns that it isn't. Here's the blueprint, and it prints not connected and doesn't emit anything.

    Name:  socketCheckConnect.PNG
Views: 154
Size:  334.7 KB

    And this is the log for the connection with this blueprint

    Name:  socketConnected.PNG
Views: 153
Size:  31.1 KB

  16. #96
    0
    Quote Originally Posted by pinkgoldpeach View Post
    Something I forgot to say, I am not sure the connection is properly established.
    Because if I check if it is connected, it returns that it isn't. Here's the blueprint, and it prints not connected and doesn't emit anything.

    Name:  socketCheckConnect.PNG
Views: 154
Size:  334.7 KB

    And this is the log for the connection with this blueprint

    Name:  socketConnected.PNG
Views: 153
Size:  31.1 KB
    Interesting, I will have to reproduce this. For now I've added the issue here: https://github.com/getnamo/socketio-client-ue4/issues/45 for tracking purposes.

    Note that the above graph may not be doing what you want it to do. The act of connecting is multi-threaded and asynchronous, meaning that the function to connect returns before a connection is established. In your graph you try to emit right after calling connect, but when that call happens its almost guaranteed to not be connected. Typically if you want something to emit on begin play, after you've connected, you do this in the On Connected event dispatch found on your SocketIOClient component. That way you can be sure you've connected to your service before you make the emit call. Since you're also emitting to a specified namespace, consider using the On Socked Namespace Connected instead, though from your log it appears you never connect to the /events namespace (check your server code).

    That said the plugin should never cause a crash, and emits should be queued up and emitted whenever a connection is established/reestablished so I'll try to replicate this issue on my next plugin pass and make sure that base is covered. Keep me posted if changing your emit to happen on connection solves your crashes though, as this is just an educated guess at this stage.
    Last edited by getnamo; 05-24-2017 at 06:23 PM.

  17. #97
    1
    The problem with the crash on emitting persists.
    I don't have any crashes if the server raises an exception after handling the event, which is really weird. As soon as the server responds to my request, everything crashes. I am not using an emit with callback. The exception suppresses any responses, therefore unreal engine doesn't crash. Naturally this is not a solution.

    when I emit on connected it doesn't change anything and emitting on socket namespace connected just doesn't send the event - because the client connects to the correct namespace only on emitting.

    A friend of mine has created a small project for you to reproduce the crash. It would be nice if you could check it out on github, there are also instructions on how to reproduce the crash. https://github.com/j-be/ue4-socketio-crash

  18. #98
    0
    Hi everybody!

    I've found that after an "Open Level" node, the client socket disconnect and loses the session with the server.
    This isn't a problem after a login procedure because, for example, I am able to re-inject the login again via the "Option String", but later if I made a match vs another player with a room, then that room is destroyed after disconnection.

    Is it possible to not disconnect the client after "Open Level"? Or at least, if it's not possible, connect to the previous session with the old Session ID?

    Below you can find the server log: every disconnection here is caused by changing level.

    Last edited by Wisdom-HELLy; 06-20-2017 at 08:23 AM. Reason: better problem analysis

  19. #99
    0
    hi @getnamo, thanks for awesome plugin. I have a question. Can I do live stream with this plugin? I mean I want to show gameplay on a web page. you can think like twitch.

  20. #100
    0
    Quote Originally Posted by hydrojan View Post
    hi @getnamo, thanks for awesome plugin. I have a question. Can I do live stream with this plugin? I mean I want to show gameplay on a web page. you can think like twitch.
    You can pipe any data you want through the sockets, including video so there's nothing stopping your there. The caveat is that socket.io in this implementation uses websockets which are based on TCP. This means that when some data does get dropped it will wait until that lost data re-transmitted and received before continuing which may not be the ideal response in the edge cases.

    That said many modern streaming services do use TCP over port 80 with a buffer cache system and the streams are typically delayed up to ~20 seconds for both encoding purposes and to ensure a smooth overall experience.

    The usual rule with TCP vs UDP is can you can accept 1-5 sec delay spikes in worst case scenarios? In this use case I believe that is ok and spikes can be mitigated with the aforementioned buffered cache.

    In terms of how, you would likely want to take the rendered frame buffers and pipe them through a codec and then chunk that data to your web service. There's a twitch streaming plugin in the engine you could look into for a reference: https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Plugins/Runtime/TwitchLiveStreaming

  21. #101
    0
    Nice work! Thank you for your great plugin!
    I have a problem. As far as I understand, the only way to use this plugin is to have an 'master' actor and attach 'SocketIOClientComponent' to make it running. But in this way, I have difficulties in map switching.
    Because the 'master' needs to be keep alive between levels, in order to maintain the socket connection. But after some investigation, it seems pretty hard to keep actors alive after map switching.(https://forums.unrealengine.com/showthread.php?3435-Keeping-Actors-Between-Levels, and seamless traveling is not supported in PIE)

    I am wondering if there are any ways to solve this problem.

    Thank you!

  22. #102
    0
    Quote Originally Posted by thelONE View Post
    Nice work! Thank you for your great plugin!
    I have a problem. As far as I understand, the only way to use this plugin is to have an 'master' actor and attach 'SocketIOClientComponent' to make it running. But in this way, I have difficulties in map switching.
    Because the 'master' needs to be keep alive between levels, in order to maintain the socket connection. But after some investigation, it seems pretty hard to keep actors alive after map switching.(https://forums.unrealengine.com/showthread.php?3435-Keeping-Actors-Between-Levels, and seamless traveling is not supported in PIE)

    I am wondering if there are any ways to solve this problem.

    Thank you!
    If the SocketIOClientComponent is not appropriate for your use case, you can drop down to the native C++ class FSocketIONative which you can manually manage the lifetime using smart pointers (e.g. TSharedPtr<FSocketIONative> ) or raw new/delete. The component uses this internally so check out https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Private/SocketIOClientComponent.cpp for an example use case.

    You can also check out ways to keep actors alive throughout map transitions:
    - https://answers.unrealengine.com/questions/380419/persistent-blueprints-across-maps.html
    - https://forums.unrealengine.com/showthread.php?3435-Keeping-Actors-Between-Levels (which you have seen)
    generally speaking actors, it appears will get destroyed between levels and reinitialized.

    Or you can allow a new socketio component to reconnect when a map loads using e.g. a unique token to synchronize the old state/re-emit any required events. I'd generally recommend this structure as it is the only one that allows you to keep a blueprint only workflow. If you can think of a better blueprint supported workflow, give an example and we can try to figure out a way to make it happen.

    Note that multiple simultaneous SocketIOClientComponents are possible, and this plugin doesn't have an opinion on just having one master actor to connect to a server. The components are fairly lightweight and I've done tests with up to ~1000 of them in a single level (I recommend to use fewer than 40 simultaneously in real use cases however).
    Last edited by getnamo; 07-18-2017 at 03:05 AM.

Page 3 of 3 FirstFirst 123

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •