# Connection dropping when sending large Signal Message

**URL:** <https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [March 2, 2023, 4:43pm UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465 "2023-03-02T16:43:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnPHILIPwilson](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/johnphilipwilson/32/2102_2.png) [@johnPHILIPwilson](https://openvidu.discourse.group/u/johnPHILIPwilson)\
**Post date:** [March 2, 2023, 4:43pm UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/1 "2023-03-02T16:43:52Z")

</div>

I’m trying to implement a multimedia chat capability in my application and using session.signal to send text, voice and image messages.

I have managed to get text and voice working, however when trying to send images the connection is dropped and automatically reconnected without the SignalEvent being sent:

main.183a09b8ec6afd7a.js:1 Websocket connection lost (reconnecting)  
main.183a09b8ec6afd7a.js:1 Websocket reconnected  
main.183a09b8ec6afd7a.js:1 Recovered connection in Session BA123  
main.183a09b8ec6afd7a.js:1 Re-establishing media connections…  
main.183a09b8ec6afd7a.js:1 There were no media streams in need of a reconnection

the images is base64 encoded and just less than 500kB in size.

I’ve checked the documentation and there is no mention of a maximum data payload size for session.signal.

Is my only option to bypass session.signal and transfer the large messages via a separate application server API?

---

<div class="post-metadata">

**Author:** ![johnPHILIPwilson](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/johnphilipwilson/32/2102_2.png) [@johnPHILIPwilson](https://openvidu.discourse.group/u/johnPHILIPwilson)\
**Post date:** [March 2, 2023, 5:19pm UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/2 "2023-03-02T17:19:27Z")

</div>

With further tests I’ve found that a data payload of just less than 50kB works, however a data payload of 60kB fails.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [March 3, 2023, 10:07am UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/3 "2023-03-03T10:07:16Z")

</div>

Signaling API is not designed to send large chunks of data. If you want to share multimedia files or other big pieces of data, you will have to build that on top of OpenVidu connections.

---

<div class="post-metadata">

**Author:** ![johnPHILIPwilson](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/johnphilipwilson/32/2102_2.png) [@johnPHILIPwilson](https://openvidu.discourse.group/u/johnPHILIPwilson)\
**Post date:** [March 3, 2023, 2:10pm UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/4 "2023-03-03T14:10:29Z")

</div>

hmm… supporting multimedia chat does not feel like an unreasonable requirement for a video/voice/text comms API… common functionality in most messaging apps these days like WhatsApp, Facebook Messanger, etc.

---

<div class="post-metadata">

**Author:** ![vsx-sieber](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/vsx-sieber/32/2172_2.png) [@vsx-sieber](https://openvidu.discourse.group/u/vsx-sieber)\
**Post date:** [March 6, 2023, 5:36pm UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/5 "2023-03-06T17:36:37Z")

</div>

The data channels of most WebRTC implementations do not support large chunks of data, since this is not what this channel is supposed to be used for.  
You could serialize and chunk your data and send it in smaller packets. Or (temporarily) upload them to a server and only send information about where to find the data (e.g. a download link).

---

<div class="post-metadata">

**Author:** ![johnPHILIPwilson](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/johnphilipwilson/32/2102_2.png) [@johnPHILIPwilson](https://openvidu.discourse.group/u/johnPHILIPwilson)\
**Post date:** [March 13, 2023, 11:20am UTC](https://openvidu.discourse.group/t/connection-dropping-when-sending-large-signal-message/4465/6 "2023-03-13T11:20:48Z")

</div>

I’ve opted to do something similar, I’m using signal to transfer the metadata of the media message and the tus protocol for resumable upload of the larger image/audio/video recordings, using the tus-js-client and tus-node-server in my fastify application server api.
