# TCP request node

**URL:** <https://discourse.nodered.org/t/tcp-request-node/42624>\
**Category:** General\
**Created:** [14 March 2021 16:24 UTC](https://discourse.nodered.org/t/tcp-request-node/42624 "2021-03-14T16:24:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 March 2021 16:24 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/1 "2021-03-14T16:24:55Z")

</div>

I am using a TCP request node to keep connection open with one of my servers. This morning I had to perform maintenance on the network and I have switched off the server (so the IP was no more reachable). The TCP request node status kept displaying "connected" and this is a problem as I am monitoring its status to fire events if disconnected!  
How can this happen and how can I have a prompt notification in such a case?

---

<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:** [14 March 2021 16:32 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/2 "2021-03-14T16:32:35Z")

</div>

Is this not due to TCP timeouts? Was the TCP connection gracefully shutdown by the other side?

What are you using this TCP connection for anyhow? (what does it connect to on the other side - another node-red?) - there may be a better solution.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 March 2021 16:34 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/3 "2021-03-14T16:34:36Z")

</div>

No, it is a bTicino/Legrand gateway. The TCP connection was not gracefully shutdown, but it is now more than 10 minutes that it is off, and the node still shows "connected". Is there a timeout?

---

<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:** [14 March 2021 16:38 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/4 "2021-03-14T16:38:57Z")

</div>

You could back it up with regular ping requests.

Alternatively, does that gateway do other protocols? (I assume you are using raw TCP at the moment) If it did (for example modbus) you could poll an address & check for errors.

PS, give your TCP the obligatory 20 mins.  
PS2 are you certain the TCP node in question / gateway in question are the correct ones (check settings)

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 March 2021 17:22 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/5 "2021-03-14T17:22:13Z")

</div>

> [@Steve-Mcl](#):
>
> PS, give your TCP the obligatory 20 mins.

What do you mean here? I have set the tcp node as "keep connection open"

---

<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:** [13 May 2021 17:22 UTC](https://discourse.nodered.org/t/tcp-request-node/42624/6 "2021-05-13T17:22:43Z")

</div>

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