# Buffer tcp requests

**URL:** <https://discourse.nodered.org/t/buffer-tcp-requests/82316>\
**Category:** General\
**Tags:** function-node\
**Created:** [24 October 2023 22:55 UTC](https://discourse.nodered.org/t/buffer-tcp-requests/82316 "2023-10-24T22:55:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![geoffatblacktusk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/geoffatblacktusk/32/28009_2.png) [@geoffatblacktusk](https://discourse.nodered.org/u/geoffatblacktusk)\
**Post date:** [24 October 2023 22:55 UTC](https://discourse.nodered.org/t/buffer-tcp-requests/82316/1 "2023-10-24T22:55:03Z")

</div>

I have an application where I am listening for messages on tcp request nodes, the messages are delimited by \n characters and I use this to close the connection and reopen after 100ms, ready for the next message.  
This has been working fine until recently, when I have found that we are sometimes receiving multiple messages simultaneously, which is causing the app to miss the subsequent messages until we have reconnected.  
My question, is if I use the node option to never return (ie. keep the connection open), how can I parse the message stream such that I can still pass individual messages at the \n delimiter to the next node?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 October 2023 23:17 UTC](https://discourse.nodered.org/t/buffer-tcp-requests/82316/2 "2023-10-24T23:17:09Z")

</div>

If the messages are strings then the tcp request node can be set to return strings, and then the keep open option then has a split option eg

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07bc1fc4776a620ff7775d09512ac5421bd051e2.png)

If they really are buffers then you could use a split node after the tcp request node

---

<div class="post-metadata">

**Author:** ![geoffatblacktusk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/geoffatblacktusk/32/28009_2.png) [@geoffatblacktusk](https://discourse.nodered.org/u/geoffatblacktusk)\
**Post date:** [24 October 2023 23:36 UTC](https://discourse.nodered.org/t/buffer-tcp-requests/82316/3 "2023-10-24T23:36:56Z")

</div>

Thanks Dave, that does look like exactly what I require, however, I assume this feature is not available in NodeRed v2.x?  
I have an installed base using 2.x and Electron 15, we are running on Node 14.18, so we probably satisfy the pre-requisites for Node-Red 3, what gotchas should I look out for if we were to try and upgrade?

---

<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:** [23 December 2023 23:37 UTC](https://discourse.nodered.org/t/buffer-tcp-requests/82316/4 "2023-12-23T23:37:23Z")

</div>

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