# Tcp: howto close inbound connection

**URL:** <https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850>\
**Category:** General\
**Created:** [18 October 2019 09:54 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850 "2019-10-18T09:54:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![billyrudi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billyrudi/32/13307_2.png) [@billyrudi](https://discourse.nodered.org/u/billyrudi)\
**Post date:** [18 October 2019 09:54 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/1 "2019-10-18T09:54:16Z")

</div>

Hi, how i can clos tcp client connection for the current session client?  
regards Paolo

---

<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:** [18 October 2019 17:11 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/2 "2019-10-18T17:11:22Z")

</div>

I don't think you can.

---

<div class="post-metadata">

**Author:** ![billyrudi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billyrudi/32/13307_2.png) [@billyrudi](https://discourse.nodered.org/u/billyrudi)\
**Post date:** [18 October 2019 19:02 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/3 "2019-10-18T19:02:31Z")

</div>

Where i can find in debian sources of this control so i can try to midify?

---

<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:** [18 October 2019 20:46 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/4 "2019-10-18T20:46:55Z")

</div>

the tcp nodes are core nodes so are built in. - the source is here - [https://github.com/node-red/node-red/tree/master/packages/node\_modules/%40node-red/nodes/core/network](https://github.com/node-red/node-red/tree/master/packages/node_modules/%40node-red/nodes/core/network)

---

<div class="post-metadata">

**Author:** ![billyrudi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billyrudi/32/13307_2.png) [@billyrudi](https://discourse.nodered.org/u/billyrudi)\
**Post date:** [20 October 2019 07:33 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/5 "2019-10-20T07:33:20Z")

</div>

hi, tanks for answer.  
what this means? (line 323)  
if (node.doend === true) {  
end = true;  
if (client) { node.status({}); client.destroy(); }  
}  
node.doend ???

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [20 October 2019 12:04 UTC](https://discourse.nodered.org/t/tcp-howto-close-inbound-connection/16850/6 "2019-10-20T12:04:43Z")

</div>

> [@billyrudi](#):
>
> node.doend ???

Hi @billyrudi,

When you activate (in the TCP-Out node's config screen) this checkbox:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/22784fc42c1c7c412f84665a62f44abcc5c4ce01.png)

Then you will see that your `node.doend` will become true:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7d459a99b415f1d49b4dd962df6edaaab6dff63c.png)

So as soon as a input message arrives in the TCP-Out node, the client connection will be closed:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b14a3a5948d13109ef858d652cf5193bb81e6ba6.png)

Bart
