# How to send acknowledgement with TCP

**URL:** <https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770>\
**Category:** General\
**Created:** [17 March 2021 12:11 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770 "2021-03-17T12:11:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathishkumarc14](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@sathishkumarc14](https://discourse.nodered.org/u/sathishkumarc14)\
**Post date:** [17 March 2021 12:11 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770/1 "2021-03-17T12:11:54Z")

</div>

Continuing the discussion from [How to send acknowledgement in tcp](https://discourse.nodered.org/t/how-to-send-acknowledgement-in-tcp/29074):

We are having TCP listener (tcp in) with node RED. When TCP client device sends data to the node red, how can send acknowledgement (like REST response) to the client? Is there any methods available?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 March 2021 13:54 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770/2 "2021-03-17T13:54:27Z")

</div>

Use a `TCP out` node to send whatever response you need to.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/245fb2a95fc5c28b320e9bf1fa75b4ce3330eda0.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5e72ce9d07043c2ff403bc130b67c2d0d9c49b5a.png)

Am i misunderstanding your requirement?

---

<div class="post-metadata">

**Author:** ![sathishkumarc14](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@sathishkumarc14](https://discourse.nodered.org/u/sathishkumarc14)\
**Post date:** [18 March 2021 07:19 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770/3 "2021-03-18T07:19:34Z")

</div>

Thanks for the reply.

I am simulating TCP client and TCP server with 2 Node RED instances.  
**TCP Client:**

```auto
[{"id":"f4ef0b95.8d83b8","type":"inject","z":"3b9021bc.3cd74e","name":"Node RED 01","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"000000000000008c08010000013feb55ff74000f0ea850209a6900009400d6120000001e09010002000300040016014703f0001504c8000c0900730a00460b00501300464306d7440000b5000bb60007422e9f180000cd0386ce000107c700000000f10000601a46000001344800000bb84900000bb84a00000bb84c00000000024e0000000000000000cf00000000000000000100003fca","payloadType":"str","x":380,"y":100,"wires":[["43bf8d1a.3dc1d4"]]},{"id":"43bf8d1a.3dc1d4","type":"function","z":"3b9021bc.3cd74e","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":503,"y":100,"wires":[["84e19867.dda908"]],"l":false},{"id":"84e19867.dda908","type":"tcp out","z":"3b9021bc.3cd74e","host":"10.23.50.3","port":"1001","beserver":"client","base64":false,"end":false,"name":"","x":660,"y":100,"wires":[]}]

```

**TCP Server:**

```auto
[{"id":"9256fb27.499c88","type":"tcp in","z":"319467b8.0c7a48","name":"","server":"server","host":"localhost","port":"1001","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":130,"y":240,"wires":[["86c062cf.f3644","f67b71c4.fe1cd"]]},{"id":"f67b71c4.fe1cd","type":"function","z":"319467b8.0c7a48","name":"","func":"\nmsg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":340,"y":320,"wires":[["710be7a3.43fe58","c0c5df38.ac211"]]},{"id":"c0c5df38.ac211","type":"debug","z":"319467b8.0c7a48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":240,"wires":[]},{"id":"710be7a3.43fe58","type":"tcp out","z":"319467b8.0c7a48","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":600,"y":320,"wires":[]}]

```

I am trying to send Reply to TCP client from TCP Server. Is there any possibility to read the server response at TCP client instance?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 March 2021 07:34 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770/4 "2021-03-18T07:34:46Z")

</div>

Use a TCP request node on the client, then you'll get response.

---

<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:** [17 May 2021 07:35 UTC](https://discourse.nodered.org/t/how-to-send-acknowledgement-with-tcp/42770/5 "2021-05-17T07:35:03Z")

</div>

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