# TCP request re-use

**URL:** https://discourse.nodered.org/t/tcp-request-re-use/2825
**Category:** General
**Created:** [4 September 2018 07:58 UTC](https://discourse.nodered.org/t/tcp-request-re-use/2825 "2018-09-04T07:58:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kallb123](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kallb123](https://discourse.nodered.org/u/Kallb123)
#### Post date: [4 September 2018 07:58 UTC](https://discourse.nodered.org/t/tcp-request-re-use/2825/1 "2018-09-04T07:58:43Z")

</div>

I have a device I want to query with a specific sequence of commands. I have used the TCP request node, which sends the first message fine. I can see the message go out in Wireshark and get an acknowledgment. The acknowledgement carries no data though, so node-red seems doesn't seem to realise there's been any response. If I carry on anyway and try to send the next message in the set I get the error "TypeError: Invalid data, chunk must be a string or buffer, not object". I understand what this is saying, but the payload is certainly a string (tried buffer too) and the payload works fine if I send it before the first message. If I try to send the same message twice, it works the first time but gives that error on the second send. Indicating that the data itself isn't the problem.

How can I get the node to send sequential payloads without expecting anything more than an empty acknowledgement?

I have tried opening fresh connections each time, which doesn't error on the tcp request, but also doesn't work for keeping a session.

---

<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: [4 September 2018 08:17 UTC](https://discourse.nodered.org/t/tcp-request-re-use/2825/2 "2018-09-04T08:17:50Z")

</div>

the tcp request node in 0.19 currently has a bug that gives that error. A fix is in master and will be released soon. see here if you want to apply it manually.

> <https://github.com/node-red/node-red/commit/8e9815fb91e04a9665ca8b336c07cb8c10e88690>

---

<div class="post-metadata">

### Author: ![Kallb123](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kallb123](https://discourse.nodered.org/u/Kallb123)
#### Post date: [4 September 2018 08:22 UTC](https://discourse.nodered.org/t/tcp-request-re-use/2825/3 "2018-09-04T08:22:14Z")

</div>

Ah! So if I install from github then the fix will be present? Hopefully that fixes my issue!

---

<div class="post-metadata">

### Author: ![Kallb123](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kallb123](https://discourse.nodered.org/u/Kallb123)
#### Post date: [4 September 2018 08:29 UTC](https://discourse.nodered.org/t/tcp-request-re-use/2825/4 "2018-09-04T08:29:58Z")

</div>

Sorted. Cloned from github and now it send the sequential messages correctly. Many thanks!
