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

Unable to connect using PIE on MacOs UE5.1

Open JuDePom opened this issue 2 years ago • 10 comments

Hi,

We are currently working on a project using your great work, but we stumped over a problem regarding the play in editor with MacOS (with M1 max).

With Windows, everything works like a charm, we can connect to a local or distant server. But when using Mac, the connection is not established in the PIE (local or distant, with SSL or not), while the exported version works fine. (Looks like #313 with the iPhone).

We used the C++ version, with UE directly from Epic (not built from source).

For now we don't see where the problem is, but we are willing to work with you on that if you want it too. In any case, any fix will lead to a PR.

If you have any advices or hint to give us, our eyes are wide opened ;)

Thanks for your time, Judepom & Nicoooooo

JuDePom avatar Jan 05 '23 14:01 JuDePom

I'm having this same problem on M1 Pro. Windows also works just fine for me.

JackFlukinger avatar Jan 22 '23 21:01 JackFlukinger

Mac isnt my main platform, but I'll have more open source hours in about 1-2 weeks and should be able to at least get some idea of where the issue could be. Any logs/minimal projects to repro you can provide would be helpful

getnamo avatar Jan 24 '23 19:01 getnamo

Minimum repro would just be to try to connect to a local socketio server from the project via play in editor mode. Would be great to get this figured out! Are there some flags that I should set to get all the debug logging?

JackFlukinger avatar Jan 24 '23 19:01 JackFlukinger

Just the saved folder logs should suffice.

It's likely related to openssl pragma barriers for Mac if I had a speculative guess.

Also see if this option exists for Mac/can be toggled and if it does anything: https://github.com/getnamo/SocketIOClient-Unreal#ios

getnamo avatar Jan 24 '23 19:01 getnamo

That's not an option on Mac, and there's no problem with local HTTP connections. As far as the log files go -- SocketIOClient doesn't log anything. Also, I'm using the native client.

JackFlukinger avatar Jan 24 '23 20:01 JackFlukinger

Small update, it doesn't only affect M1 CPU, tested on a MacPro with an intel i9, it was exactly the same.

On PIE, it seams that the function create in Asio service_registry.hpp is never called and after that I have weird service IDs (in service_registry.ipp do_use_service).

For an unknown reason since MacOS update, I can't use a debugger, so I had to add a lot of UE_LOGS in various function calls. If you want those logs from the PIE and the exported one, just contact me.

JuDePom avatar Jan 25 '23 17:01 JuDePom

Can confirm I was able to replicate the issue (no connection in PIE, works fine in packaged mode). Unsure atm of what the issue is, will gladly take some logs if you have any.

getnamo avatar Nov 01 '23 21:11 getnamo

I also have this issue on an M2/MacOS 14.1.2 running UE 5.2.1 and Node v18.18.2. Server works great between two browser windows, but not at all in Unreal

@getnamo : I've attached the logfile : warning/error summary is as follows :

Warnings :

LogPluginManager: Warning: Engine version string in SocketIOClient-Unreal-Example-master/UnrealClient/Plugins/SocketIOClient/SocketIOClient.uplugin could not be parsed ("5.2")

Errors :

LogClass: Error: EnumProperty FSIOJ_NamedType::Type is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogClass: Error: BoolProperty FSIOJ_NamedType::bIsArray is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogClass: Display: 2 Uninitialized script struct members found including 0 object properties
LogAutomationTest: Error: UObject.Class AttemptToFindUninitializedScriptStructMembers will be marked as failing due to errors being logged
LogAutomationTest: Error: LogClass: EnumProperty FSIOJ_NamedType::Type is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogAutomationTest: Error: LogClass: BoolProperty FSIOJ_NamedType::bIsArray is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h

logfile.txt

laffan avatar Dec 04 '23 06:12 laffan

我在运行 UE 5.2.1 和 Node v2.18.1 的 M2.1.2/MacOS 18.18.2 上也遇到了这个问题。服务器在两个浏览器窗口之间运行良好,但在虚幻引擎中则完全不行

:我附上了日志文件:警告/错误摘要如下:

警告:

LogPluginManager: Warning: Engine version string in SocketIOClient-Unreal-Example-master/UnrealClient/Plugins/SocketIOClient/SocketIOClient.uplugin could not be parsed ("5.2")

错误:

LogClass: Error: EnumProperty FSIOJ_NamedType::Type is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogClass: Error: BoolProperty FSIOJ_NamedType::bIsArray is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogClass: Display: 2 Uninitialized script struct members found including 0 object properties
LogAutomationTest: Error: UObject.Class AttemptToFindUninitializedScriptStructMembers will be marked as failing due to errors being logged
LogAutomationTest: Error: LogClass: EnumProperty FSIOJ_NamedType::Type is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h
LogAutomationTest: Error: LogClass: BoolProperty FSIOJ_NamedType::bIsArray is not initialized properly. Module:SIOJEditorPlugin File:Public/SIOJ_BreakJson.h

logfile.txt

Hello, I have the same problem, do not know how to solve

wenzheng-wen avatar Apr 23 '24 13:04 wenzheng-wen

Any progress with this? I've been hacking away at it with debug print statements and this it what I've figured out: On UE 5.3.2 on an Intel Mac:

  • SocketIOLib/Private/internal/sio_client_impl client_impl() calls m_client.init_asio().
  • ThirdParty/websocketpp/websocketpp/transport/asio/endpoint init_asio() bounces around a bit and then (from init_asio(io_service_ptr prt, lib::error_code & ec)) calls lib::make_shared<lib::asio::ip::tcp::acceptor>(lib::ref(*m_io_service))
  • This gets us to ThirdParty/asio/asio/include/asio/basic_socket_acceptor basic_socket_acceptor(io_context)
  • which calls ThirdParty/asio/asio/include/asio/basic_io_object basic_io_object(io_context)
  • which calls ThirdParty/asio/asio/include/asio/impl/io_context use_service<asio::detail::reactive_socket_service<asio::ip::tcp>>(io_context)
  • which calls ThirdParty/asio/asio/include/asio/detail/impl/service_registry service_registry::do_use_service(key, factory, owner)
  • which then attempts to call factory(owner)
  • at which point it disappears. (factory should be asio::detail::service_registry::create<asio::detail::reactive_socket_service<asio::ip::tcp>, asio::io_context>(void*) but execution never gets there)

later on, when kevents (kernel events) happen, the kevent_reactor attempts to start its scheduler, which hasn't been properly registered. It works for the DNS validation, but when the reactor attempts to connect to the actual socket and gets asio::error::in_progress, it adds work to the (corrupt) scheduler and then hangs.

I used the websocketpp example 'ThirdParty/websocketpp/examples/echo_client/echo_client.cpp` and massaged it to look as much like client_impl as I could. But I could not get the example to exhibit the same symptoms.

Hope this is helpful.

trsoluti avatar May 06 '24 13:05 trsoluti