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

Sending large amount of data disconnects socket with CLOSE_REASON_NORMAL

Open reidsanders opened this issue 2 years ago • 9 comments

In UE logs all I see is

SocketIO: SocketIO Disconnected 0C5vfmuuuxFBqG3zAAAB reason: CLOSE_REASON_NORMAL LogTemp: Display: X2:3000054 4000000 or sometimes nothing at all.

On the server end:

disconnect 0C5vfmuuuxFBqG3zAAAB INFO:aiohttp.access:::1 [02/Apr/2022:21:43:52 +0000] "GET /socket.io/?EIO=4&transport=websocket&t=1648935832 HTTP/1.1" 101 0 "-" "WebSocket++/0.8.1"

Basic function used to capture 512x512 TextureRenderTarget2D (using Realtime Import) image Or with no other plugins (need to increase the "infinite loop" detector threshold to ~1e9).
image

Unfortunately this is very little to go on. Are there other logs that may help shed light on this (and where are they located)? A verbose mode? I suspect some sort of max buffer size or timeout, but I haven't been able to find anything like that.

Thanks!

reidsanders avatar Apr 02 '22 18:04 reidsanders

That is a strange one, if you run the project in c++ debug mode, you can pop a breakpoint on e.g. https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Private/SocketIONative.cpp#L375 and catch it when it closes and then traverse up the stack to get a bit more information. I do suspect some buffer limit, but at least on local tests I've done, I haven't had issues with ~25meg dumps between socket.io connections, there might be something else that is adding to this issue. What unreal and plugin versions are you using? Are you connecting on a local network or across the internet? This might help trying to repro issue

getnamo avatar Apr 07 '22 02:04 getnamo

I am running unreal engine 4.27.2 (Version: 4.27.2-18319896+++UE4+Release-4.27), and most recent commits in ml-remote-server c0d6c90 ), machine-learning-remote-ue4 c2fc560 and socket-client-ue4: https://github.com/getnamo/SocketIOClient-Unreal/commit/1719eecfaeae7824215f27a36763f03957e1602d (I see it is changing as I write this), but I have also been running the 1.8.0 tag for 4.27 (https://github.com/getnamo/socketio-client-unreal/releases/tag/v1.8.0) with same results.

I am running the server locally.

Trace back (note this does not always happen, it seems sending even larger images fails without even hitting the "CLOSE_REASON_NORMAL" path.

[UE4Editor-SocketIOClient-Win64-DebugGame.dll!FSocketIONative::SetupInternalCallbacks::__l2::<lambda>(const sio::client::close_reason & reason) Line 375	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!sio::client_impl::on_close(std::weak_ptr<void> con) Line 510	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::connection<websocketpp::config::asio_client>::handle_terminate(websocketpp::connection<websocketpp::config::asio_client>::terminate_status tstat, const std::error_code & ec) Line 1774	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::handle_async_shutdown(std::shared_ptr<asio::basic_waitable_timer<std::chrono::steady_clock,asio::wait_traits<std::chrono::steady_clock>>> shutdown_timer, std::function<void __cdecl(std::error_code const &)> callback, const std::error_code & ec) Line 1130	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::transport::asio::basic_socket::connection::async_shutdown(std::function<void __cdecl(std::error_code const &)> h) Line 257	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::async_shutdown(std::function<void __cdecl(std::error_code const &)> callback) Line 1053	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::connection<websocketpp::config::asio_client>::terminate(const std::error_code & ec) Line 1740	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::connection<websocketpp::config::asio_client>::handle_read_frame(const std::error_code & ec, unsigned __int64 bytes_transferred) Line 990	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::handle_async_read(std::function<void __cdecl(std::error_code const &,unsigned __int64)> handler, const std::error_code & ec, unsigned __int64 bytes_transferred) Line 897	C++
 	[External Code]	
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::asio_handler_invoke<asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,std::error_code,unsigned __int64>>(asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,std::error_code,unsigned __int64> & function, ...) Line 69	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::strand_service::dispatch<asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,std::error_code,unsigned __int64>>(asio::detail::strand_service::strand_impl * & impl, asio::detail::binder2<websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,std::error_code,unsigned __int64> & handler) Line 61	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>::operator()<std::error_code,unsigned __int64>(const std::error_code & arg1, const unsigned __int64 & arg2) Line 98	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>::operator()(const std::error_code & ec, unsigned __int64 bytes_transferred, int start) Line 286	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::asio_handler_invoke<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>>>(asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>> & function, ...) Line 69	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::completion_handler<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>>>::do_complete(void * owner, asio::detail::win_iocp_operation * base, const std::error_code & __formal, unsigned __int64 __formal) Line 69	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::strand_service::dispatch<asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>>>(asio::detail::strand_service::strand_impl * & impl, asio::detail::rewrapped_handler<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>> & handler) Line 87	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::asio_handler_invoke<asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64>,asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>(asio::detail::binder2<asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>,std::error_code,unsigned __int64> & function, asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running> * this_handler) Line 231	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::win_iocp_socket_recv_op<asio::mutable_buffers_1,asio::detail::read_op<asio::basic_stream_socket<asio::ip::tcp>,asio::mutable_buffers_1,asio::mutable_buffer const *,asio::detail::transfer_at_least_t,asio::detail::wrapped_handler<asio::io_context::strand,websocketpp::transport::asio::custom_alloc_handler<std::_Binder<std::_Unforced,void (__cdecl websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>::*)(std::function<void __cdecl(std::error_code const &,unsigned __int64)>,std::error_code const &,unsigned __int64),std::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio_client::transport_config>>,std::function<void __cdecl(std::error_code const &,unsigned __int64)> &,std::_Ph<1> const &,std::_Ph<2> const &>>,asio::detail::is_continuation_if_running>>>::do_complete(void * owner, asio::detail::win_iocp_operation * base, const std::error_code & result_ec, unsigned __int64 bytes_transferred) Line 98	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::win_iocp_io_context::do_one(unsigned long msec, std::error_code & ec) Line 420	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::detail::win_iocp_io_context::run(std::error_code & ec) Line 162	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!asio::io_context::run() Line 61	C++
 	UE4Editor-SocketIOLib-Win64-DebugGame.dll!sio::client_impl::run_loop() Line 242	C++
 	[External Code]

seems to be failing on

if (handler) {
            handler(tec,bytes_transferred);
        } else {
            // This can happen in cases where the connection is terminated while
            // the transport is waiting on a read.
            m_alog->write(log::alevel::devel,
                "handle_async_read called with null read handler");
        }

Not sure how to access the "External Code" Because that seems to trigger this.

Thanks!

reidsanders avatar Apr 07 '22 18:04 reidsanders

Try latest socketio plugin (v1.10 for ue4.27 or v2.3.0 for ue5) and see if issue persists

getnamo avatar Apr 27 '22 16:04 getnamo

Thanks for the help (and useful libraries)!

I tried this for both UE4.27.2 UE5 5.0.1, both fail in the same way. Right now I'm working around this by writing the image to disk, but that's slow and generally not great.

More reproduction details and failed attempts (has anyone tried reproducing?): I also tried making new blank projects, recursively cloned MachineLearningRemote-Unreal and SocketClientIO-Unreal into Plugins directory, checked out the v1.10 and v2.3.0 commits respectively.

The UE5 project failed to compile,

Error C2039 'ClearCallbacks': is not a member of 'FSocketIONative' VoiceTestUE5\Plugins\MachineLearningRemote-Unreal\Source\MachineLearningRemote\Private\MachineLearningRemoteComponent.cpp 136

I commented out that line ( //Socket->ClearCallbacks();), and it compiled, but still had the bug on large files.

I created a simple test script in the Server/ml-remote-server/Scripts

from mlpluginapi import MLPluginAPI
import unreal_engine as ue

#MLPluginAPI
class ExampleAPI(MLPluginAPI):

	#optional api: setup your model for training
	def on_setup(self):
		ue.log('hello on_setup')
		pass
		
	#optional api: parse input object and return a result object, which will be converted to json for UE4
	def on_json_input(self, input):
		ue.log('hello on_json_input')
		return {}#{'something':'something'}

	#optional api: parse input object and return a result object, which will be converted to json for UE4
	def add_image(self, input):
		ue.log('hello add_image. len(input): ' + str(len(input)))
		return "Return"

	#optional api: start training your network
	def on_begin_training(self):
		ue.log('hello on_begin_training')
		pass


#NOTE: this is a module function, not a class function. Change your CLASSNAME to reflect your class
#required function to get our api
def get_api():
	#return CLASSNAME.get_instance()
	return ExampleAPI.get_instance()

I tried with python 3.9.12 I tried using python3.7.9 and installing directly'

python -m venv .venv37
source .venv/Scripts/activate
python -m pip install python-socketio==4.3.1
python -m pip install aiohttp==3.6.1 

Using python-socketio==4.3.1 created this error:

connect async handler error
Traceback (most recent call last):
  File "C:\Users\Reid\Documents\UnrealProjects\VoiceControl\Plugins\machine-learning-remote-ue4\.venv37\lib\site-packages\engineio\asyncio_server.py", line 456, in _trigger_event
    ret = await self.handlers[event](*args)
  File "C:\Users\Reid\Documents\UnrealProjects\VoiceControl\Plugins\machine-learning-remote-ue4\.venv37\lib\site-packages\socketio\asyncio_server.py", line 484, in _handle_eio_connect
    return await self._handle_connect(sid, '/')
  File "C:\Users\Reid\Documents\UnrealProjects\VoiceControl\Plugins\machine-learning-remote-ue4\.venv37\lib\site-packages\socketio\asyncio_server.py", line 409, in _handle_connect
    namespace=namespace))
  File "C:\Users\Reid\Documents\UnrealProjects\VoiceControl\Plugins\machine-learning-remote-ue4\.venv37\lib\site-packages\socketio\asyncio_server.py", line 378, in _send_packet
    await self.eio.send(sid, encoded_packet, binary=False)
TypeError: send() got an unexpected keyword argument 'binary'

Upgrading python-socketio with

python -m pip install upgrade python-socketio led to the same "CLOSE_REASON_NORMAL" failure. Same with upgrading aiohttp.

I'll also dump a blueprint code that will generate a large array to crash it (same as screenshot above, except using SIOJLibrary instead of RealTimeImport

Begin Object Class=/Script/BlueprintGraph.K2Node_Tunnel Name="K2Node_Tunnel_0"
   bCanHaveOutputs=True
   NodePosX=-5024
   NodePosY=2816
   NodeGuid=663673C24378708331EF8F8A67D7DDA1
   CustomProperties Pin (PinId=B13542974AB63D640FB8E3959437586E,PinName="start",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_MacroInstance_2 84AFAC4449ABB472C6C2F08C285CC383,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=DB94B18848E53022535DCBBA2D155196,PinName="function",Direction="EGPD_Output",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_Knot_0 C419C0DF454FE732FEE0F9B32BA39D3E,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties UserDefinedPin (PinName="start",PinType=(PinCategory="exec"),DesiredPinDirection=EGPD_Output)
   CustomProperties UserDefinedPin (PinName="function",PinType=(PinCategory="string"),DesiredPinDirection=EGPD_Output)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_Tunnel Name="K2Node_Tunnel_1"
   bCanHaveInputs=True
   NodePosX=-2512
   NodePosY=2784
   NodeGuid=71CB96854E993BCD20237BA0C5D1EA82
   CustomProperties Pin (PinId=F956133942C00BE86436AB982AF63CEB,PinName="success",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 EA51013841AC6815ABD473851EE066C4,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=B5E5799D4AFFE2F5F45769BC0E4A1BFF,PinName="failure",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=FD41947C4514F27389538FA729C6AFAF,PinName="result",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 BCB7CC97471ACA7A49C3FEBE7C723DC9,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties UserDefinedPin (PinName="success",PinType=(PinCategory="exec"),DesiredPinDirection=EGPD_Input)
   CustomProperties UserDefinedPin (PinName="failure",PinType=(PinCategory="exec"),DesiredPinDirection=EGPD_Input)
   CustomProperties UserDefinedPin (PinName="result",PinType=(PinCategory="string"),DesiredPinDirection=EGPD_Input)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_Knot Name="K2Node_Knot_0"
   NodePosX=-4144
   NodePosY=3072
   NodeGuid=D59E66224361D4764EA034868544E1DF
   CustomProperties Pin (PinId=C419C0DF454FE732FEE0F9B32BA39D3E,PinName="InputPin",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_Tunnel_0 DB94B18848E53022535DCBBA2D155196,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=True,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=32B20B0843631C25D883D1B1417275AA,PinName="OutputPin",Direction="EGPD_Output",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 3ADACC684F6042D248F95A82C485F940,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_1"
   FunctionReference=(MemberParent=Class'"/Script/MachineLearningBase.MachineLearningBaseComponent"',MemberName="SendStringInputGraphCallback")
   NodePosX=-2864
   NodePosY=2768
   NodeGuid=1051204F43EF4D8903798A85FCEFC4E4
   CustomProperties Pin (PinId=3678DC5B462C11BE961C7996AA50BC8F,PinName="execute",PinToolTip="\nExec",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_MacroInstance_2 4782697743097471917408953DFE7AFA,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=EA51013841AC6815ABD473851EE066C4,PinName="then",PinFriendlyName=NSLOCTEXT("", "F797B167433002D7C41B0799E716A2F5", "Completed"),PinToolTip="Completed\nExec",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_Tunnel_1 F956133942C00BE86436AB982AF63CEB,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=2E731FCA48F994166F51C390F9DCDD6F,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target\nMachine Learning Base Component Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/MachineLearningBase.MachineLearningBaseComponent"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_VariableGet_1 6412DD374EFC99775BDBD6A35DB48C6E,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=96E741FB419DB2F134D57290B16C4917,PinName="InputData",PinToolTip="Input Data\nString",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_0 4D2AD17D43D19EF2CA5DA29E4392440B,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=BCB7CC97471ACA7A49C3FEBE7C723DC9,PinName="ResultData",PinToolTip="Result Data\nString",Direction="EGPD_Output",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_Tunnel_1 FD41947C4514F27389538FA729C6AFAF,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=6FE299D2472AD02CF607949A18F2A75E,PinName="LatentInfo",PinToolTip="Latent Info\nLatent Action Info Structure",PinType.PinCategory="struct",PinType.PinSubCategory="",PinType.PinSubCategoryObject=ScriptStruct'"/Script/Engine.LatentActionInfo"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultValue="(Linkage=-1,UUID=-1,ExecutionFunction=\"\",CallbackTarget=None)",AutogeneratedDefaultValue="LatentInfo",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=3ADACC684F6042D248F95A82C485F940,PinName="FunctionName",PinToolTip="Function Name\nString",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultValue="onJsonInput",AutogeneratedDefaultValue="onJsonInput",LinkedTo=(K2Node_Knot_0 32B20B0843631C25D883D1B1417275AA,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_1"
   VariableReference=(MemberName="MachineLearningRemote",bSelfContext=True)
   NodePosX=-3159
   NodePosY=2729
   NodeGuid=DD6960A049B3FDCD910E0C841178A6C0
   CustomProperties Pin (PinId=6412DD374EFC99775BDBD6A35DB48C6E,PinName="MachineLearningRemote",Direction="EGPD_Output",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/MachineLearningRemote.MachineLearningRemoteComponent"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 2E731FCA48F994166F51C390F9DCDD6F,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=E0BBC53E4B68AC474DEC3F88C8B3714C,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=BlueprintGeneratedClass'"/Game/CameraCapture/BP_CameraProbe.BP_CameraProbe_C"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_2"
   VariableReference=(MemberName="TmpRandomArray",MemberGuid=4D82EB034F6C2A19CAEE65AD316284A7,bSelfContext=True)
   NodePosX=-3504
   NodePosY=2928
   NodeGuid=5E373AAA41BDF5F73D2C0F8813E03C66
   CustomProperties Pin (PinId=3AC9EC244D30090E272D509E5B744E8C,PinName="TmpRandomArray",Direction="EGPD_Output",PinType.PinCategory="byte",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=Array,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_0 B761181B42A9D2E5A1E512AE8A8BE64A,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=67E5E93149A78F27CA84288BDF4DB121,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=BlueprintGeneratedClass'"/Game/CameraCapture/BP_CameraProbe.BP_CameraProbe_C"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_MacroInstance Name="K2Node_MacroInstance_2"
   MacroGraphReference=(MacroGraph=EdGraph'"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoop"',GraphBlueprint=Blueprint'"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros"',GraphGuid=55C904AF4B45FE1761FB55A8DB9FB801)
   NodePosX=-4544
   NodePosY=2816
   NodeGuid=F682B38D49251EF035D86B8BFB2073B3
   CustomProperties Pin (PinId=84AFAC4449ABB472C6C2F08C285CC383,PinName="execute",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_Tunnel_0 B13542974AB63D640FB8E3959437586E,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=50C2947F43A13B42434C8CA8D1A7AA43,PinName="FirstIndex",PinType.PinCategory="int",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=09AEED2948E3CCD6102AB4BBB3F373AB,PinName="LastIndex",PinType.PinCategory="int",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultValue="2000000",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=71578DC84AEEFA7F5426E19768363B96,PinName="LoopBody",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallArrayFunction_0 62FD36714CD219C3BE9915A02035B56D,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=20F888264CA7F187618A88A4547C26C8,PinName="Index",Direction="EGPD_Output",PinType.PinCategory="int",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=4782697743097471917408953DFE7AFA,PinName="Completed",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 3678DC5B462C11BE961C7996AA50BC8F,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallArrayFunction Name="K2Node_CallArrayFunction_0"
   FunctionReference=(MemberParent=Class'"/Script/Engine.KismetArrayLibrary"',MemberName="Array_Add")
   NodePosX=-4064
   NodePosY=2800
   NodeGuid=D3B80D3C4CDFA9B8DE82CE8875917519
   CustomProperties Pin (PinId=62FD36714CD219C3BE9915A02035B56D,PinName="execute",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_MacroInstance_2 71578DC84AEEFA7F5426E19768363B96,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=0521343F428F8D7F2DDBABA952ED6FF0,PinName="then",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=2F66729B4EC87A075D7AA3BC90C28267,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/Engine.KismetArrayLibrary"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultObject="/Script/Engine.Default__KismetArrayLibrary",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=F421C56F471BF363E8A86194B41DE092,PinName="TargetArray",PinType.PinCategory="byte",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=Array,PinType.bIsReference=True,PinType.bIsConst=True,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_VariableGet_3 AAAEEDB6479A9B35C3A2C0AF037BEA52,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=True,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=5DD071204671BBDFE7CBC8B8DDA02524,PinName="NewItem",PinType.PinCategory="byte",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=True,PinType.bIsConst=True,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=F1742BB7497101ED983BC8BA12975303,PinName="ReturnValue",Direction="EGPD_Output",PinType.PinCategory="int",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultValue="0",AutogeneratedDefaultValue="0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_3"
   VariableReference=(MemberName="TmpRandomArray",MemberGuid=4D82EB034F6C2A19CAEE65AD316284A7,bSelfContext=True)
   NodePosX=-4256
   NodePosY=2864
   NodeGuid=9425118E495FAEAEFD7960B55FB19BD4
   CustomProperties Pin (PinId=AAAEEDB6479A9B35C3A2C0AF037BEA52,PinName="TmpRandomArray",Direction="EGPD_Output",PinType.PinCategory="byte",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=Array,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallArrayFunction_0 F421C56F471BF363E8A86194B41DE092,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=CDFA297C4800DD2AB7395E8E8B3A3CF9,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=BlueprintGeneratedClass'"/Game/CameraCapture/BP_CameraProbe.BP_CameraProbe_C"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object
Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_0"
   bIsPureFunc=True
   FunctionReference=(MemberParent=Class'"/Script/SIOJson.SIOJLibrary"',MemberName="Base64EncodeBytes")
   NodePosX=-3248
   NodePosY=2944
   NodeGuid=1162EADF4937AEB7158983A70E0E1831
   CustomProperties Pin (PinId=EE8BD7274E96E1FF6BBC9D99CD639540,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target\nSIOJLibrary Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject=Class'"/Script/SIOJson.SIOJLibrary"',PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,DefaultObject="/Script/SIOJson.Default__SIOJLibrary",PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=B761181B42A9D2E5A1E512AE8A8BE64A,PinName="Source",PinToolTip="Source\nArray of Bytes\n\nThe string data to convert",PinType.PinCategory="byte",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=Array,PinType.bIsReference=True,PinType.bIsConst=True,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_VariableGet_2 3AC9EC244D30090E272D509E5B744E8C,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=True,bAdvancedView=False,bOrphanedPin=False,)
   CustomProperties Pin (PinId=4D2AD17D43D19EF2CA5DA29E4392440B,PinName="ReturnValue",PinToolTip="Return Value\nString\n\nA string that encodes the binary data in a way that can be safely transmitted via various Internet protocols",Direction="EGPD_Output",PinType.PinCategory="string",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,LinkedTo=(K2Node_CallFunction_1 96E741FB419DB2F134D57290B16C4917,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
End Object

reidsanders avatar Apr 29 '22 17:04 reidsanders

Ok really useful and detailed feedback, thanks. I'll try to compile an updated matched version and do some large data tests, but it will likely be a week before I have some results due to full schedule.

getnamo avatar Apr 30 '22 15:04 getnamo

Hello, I was experiencing a similar issue to this and doing the following fixed it for me In ml-remote-server/server.py Try changing: sio = socketio.AsyncServer() to sio = socketio.AsyncServer(always_connect=True,ping_timeout=180,max_http_buffer_size=5e8)

Hope this helps.

jacobay43 avatar May 03 '22 17:05 jacobay43

Thanks @jacobay43! Curiously this fix boosts the size I can send without disconnect ~3x, but not more. Changing these values to be very large does not seem to have further improvement. I also tested monitor_clients=False and async_handlers=False to no apparent effect. So default settings fail at an array size of ~800k (which seems to correspond to the ~1MB default buffer limit) Modified settings fail at ~3.2M (which corresponds to ~4.2M bytes in base64).

This makes me wonder if there's some deeper max buffer size, though grepping for this doesn't lead to anything obvious. Of course these values could be dependent on my particular hardware / setup.

That setting is a definite improvement, though its still pretty small images without compression.

reidsanders avatar May 04 '22 17:05 reidsanders

You are right. After extensive testing, I found it only boosted the size without disconnecting to a maximum of 4 - 5 times. But I feel a solution may be in a certain configuration of parameters for EngineIO in the AsyncServer constructor

jacobay43 avatar May 04 '22 18:05 jacobay43

@reidsanders, I tried approaching the problem from another angle and it seems to work. Rather than looking for a way to prevent it from disconnecting, I implemented a custom reconnect function, although this will require that you edit the source code of the plugin and rebuild the solution. First change the sio initialization to this in ml-remote-server/server.py sio = socketio.AsyncServer(max_http_buffer_size=5e8,monitor_clients=False)

Then go to your project directory and open the following file in your editor <Your Project>\Plugins\MachineLearningRemote-Unreal\Source\MachineLearningRemote\Public\MachineLearningRemoteComponent.h

Add the following method prototype to the class declaration: UFUNCTION(BlueprintCallable, Category="MLREMOTE") void ForceConnect();

Then open the following file <Your Project>\Plugins\MachineLearningRemote-Unreal\Source\MachineLearningRemote\Private\MachineLearningRemoteComponent.cpp

Add the following method body void UMachineLearningRemoteComponent::ForceConnect() { Socket->Connect(ServerAddressAndPort); }

Then build your project solution in Visual Studio or XCode

After that Create an On Disconnected From Backend event for your MachineLearningRemoteComponent in your blueprint and connect it to the ForceConnect function where the target is your MachineLearningRemoteComponent. This should immediately reconnect on the event of a disconnect

forceconnect

Hope this helps!

jacobay43 avatar May 08 '22 09:05 jacobay43