You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell using this relay, connections are made and stay alive for approx. 55 seconds before they are deemed "idle" and closed. This is prevented by the use of the heartbeat signal made every five seconds, as seen in your code.
My question is, if this is a relay server and intended to have minimal load and bandwidth between the connections, would it not be better to send off a Heartbeat message as something incredibly short (1 bit?).
It doesn't even have to be proper JSON, as it would simply be ensuring that a connection exists.
The heartbeat receiver and the default unknown data receiver both essentially return the same output:
case 'Heartbeat': // nothing to do
this.log('♥')
break
default:
break
Am I overthinking this? Is the small bit difference between a "{ type:'Heartbeat' }" string and a 0/1 negligible?
Does the understanding behind knowing a heartbeat signal is being received outweigh the tiny increase in possible performance or bandwidth?
Thanks,
The text was updated successfully, but these errors were encountered:
In general I agree, perhaps the whole protocol could also be more efficient to not use JSON and use something like protobuf (or whatever is the latest and greatest) instead. This is more refactoring to do and would be a breaking change.
As far as I can tell using this relay, connections are made and stay alive for approx. 55 seconds before they are deemed "idle" and closed. This is prevented by the use of the heartbeat signal made every five seconds, as seen in your code.
My question is, if this is a relay server and intended to have minimal load and bandwidth between the connections, would it not be better to send off a Heartbeat message as something incredibly short (1 bit?).
It doesn't even have to be proper JSON, as it would simply be ensuring that a connection exists.
The heartbeat receiver and the default unknown data receiver both essentially return the same output:
Am I overthinking this? Is the small bit difference between a "{ type:'Heartbeat' }" string and a 0/1 negligible?
Does the understanding behind knowing a heartbeat signal is being received outweigh the tiny increase in possible performance or bandwidth?
Thanks,
The text was updated successfully, but these errors were encountered: