Transport Lost error during large data publishes


Below are part of the program to transfer the binary data(e.g. image data) from python to JavaScript.

comp = Component(
        "url": u"ws://localhost:8080/ws",
        "serializers": ["msgpack"]

_session = None
_event_loop = None

async def joined(session, details):
    print("WAMP session joined.")

    global _session,_event_loop

    _session = session
    _event_loop = asyncio.get_event_loop()

# This function is called at various threads.
# ex)
# args_dict = {
#     "image": img.tobytes()		# img ... numpy.ndarray
# }
def publish_event(args_dict):
	# method 1.
    # _session.publish("test_event", args_dict)

	# method 2.
    _event_loop.call_soon_threadsafe(self._session.publish, "test_event", args_dict)

    # Exactly the same error occurs in Method 1 and Method 2.

if __name__ == "__main__":

The program basically works correctly, but if the data to be transferred is large, the following errors occur. If the data size is 500Kbytes, there is no problem at all, but if it is 4.4Mbytes, the error occurs 100%.

session leaving 'wamp.close.transport_lost'
Connection failed: ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback ApplicationSession.publish('another_event', {})
handle: <Handle ApplicationSession.publish('another_event', {})>
Traceback (most recent call last):
  File "C:\dev\Miniconda3\envs\vslam-algo\lib\asyncio\", line 88, in _run, *self._args)
  File "C:\dev\Miniconda3\envs\vslam-algo\lib\site-packages\autobahn\wamp\", line 1405, in publish
    raise exception.TransportLost()

Because of the loss of connection during the transfer of large data, it seems that an exception is raised during the occurrence of subsequent events.

This program is part of computer vision processing implemented in multi-threading, and the CPU load is relatively high.

If anyone knows the causes and workarounds, please let me know.

OS: Windows10
python: 3.7.7
autobahn: 20.7.1
crossbar: 20.8.1