# TCP request node misbehaving - not disconnecting

**URL:** <https://discourse.nodered.org/t/tcp-request-node-misbehaving-not-disconnecting/28782>\
**Category:** Dashboard\
**Created:** [23 June 2020 07:42 UTC](https://discourse.nodered.org/t/tcp-request-node-misbehaving-not-disconnecting/28782 "2020-06-23T07:42:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveve](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@daveve](https://discourse.nodered.org/u/daveve)\
**Post date:** [23 June 2020 07:42 UTC](https://discourse.nodered.org/t/tcp-request-node-misbehaving-not-disconnecting/28782/1 "2020-06-23T07:42:06Z")

</div>

Hi everybody.  
I'm using a "TCP Request" node to retrieve data from a PV monitoring system, polling it every 30 secs, but I'm struggling to get it to work correctly.

**Issue:**  
the TCP node will not disconnect or will stop sending out requests; I've tried a couple approaches which all failed in the end.

1. _TCP node set to automatically disconnect after "xx ms"_  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/7855416814fb00efd2ad213c1e3e61512945b1d2.png)  
Issue seen previously [here](https://discourse.nodered.org/t/tcp-request-node-doesnt-disconnect-bug/12466): the setup works fine for a couple minutes until - I suppose - the remote device does not return any response; the connection is not terminated and the status stays "connected" with the green dot. When this happens new connection requests are rejected/have no effects and I need to deploy the node again to resume functionality.

2. _TCP node set to keep connection open_  

What I would ideally accomplish is straight forward: send a message to the TCP node, have it return data OR an error if the remote device is not available, close the connection EVEN IF no data has been received by the node, then repeat.  
From the first post linked seems like the issue with the TCP node not returning in the first place is that a timeout is set only from when data is received... is there a way to kill the connection anyways? My second approach was trying to address this issue but it's not working.  
I've read somebody suggesting to use only TCP in/out nodes: I cannot, should be able to set the in/out port to receive the data back.

Partially a duplicate of the first linked post, but the problem is still here after a year, thought it might be worth pointing out.

Thanks! Cheers

**Info** : NodeRED v-1.0.6

---

<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 July 2020 07:42 UTC](https://discourse.nodered.org/t/tcp-request-node-misbehaving-not-disconnecting/28782/2 "2020-07-23T07:42:20Z")

</div>

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