# How to find the length of a buffer?

**URL:** <https://discourse.nodered.org/t/how-to-find-the-length-of-a-buffer/50417>\
**Category:** Dashboard\
**Created:** [31 August 2021 02:08 UTC](https://discourse.nodered.org/t/how-to-find-the-length-of-a-buffer/50417 "2021-08-31T02:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [31 August 2021 02:08 UTC](https://discourse.nodered.org/t/how-to-find-the-length-of-a-buffer/50417/1 "2021-08-31T02:08:47Z")

</div>

Guys,

My inverters send in responses to queries on UDP port 8899 - there is no differentiation or ability to say for different inverters to send to different ports etc.

I have 3 inverters talking and they all send responses to different commands to the same port.

So i need to be able to switch the inputs based on buffer length (different requests have the same response length each time) so for instance if the incoming stream is 89 bytes i know that is a response to an ID query so i would want to send that off to a buffer parser to decide which device it is by parsing through the data

On the other hand some of the queries will return info that is 129 bytes long and i will need to send that to a different parser

Is there a buffer.length property or something similar ?

Craig

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [31 August 2021 03:52 UTC](https://discourse.nodered.org/t/how-to-find-the-length-of-a-buffer/50417/2 "2021-08-31T03:52:54Z")

</div>

I got it - its just the length of the payload - i was over thinking it again

Craig

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 September 2021 03:53 UTC](https://discourse.nodered.org/t/how-to-find-the-length-of-a-buffer/50417/3 "2021-09-14T03:53:41Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
