# CLOSE\_WAIT sockets when using Web Services & SUDS

**URL:** <https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493>\
**Category:** Ignition\
**Created:** [May 27, 2014, 10:18am UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493 "2014-05-27T10:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nparlev](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@nparlev](https://forum.inductiveautomation.com/u/nparlev)\
**Post date:** [May 27, 2014, 10:18am UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493/1 "2014-05-27T10:18:30Z")

</div>

Hello,

I’m experiencing constantly increasing number of CLOSE\_WAIT sockets when I’m using SUDS library inside Gateway Event Scripts. Even the example code produces the same effect:

`import system
from suds.client import Client
url = 'http://www.w3schools.com/webservices/tempconvert.asmx?wsdl'
client = Client(url)
#print client
print client.service.CelsiusToFahrenheit(10)`

My server is:  
OS: Ubuntu 10.04

JAVA:Oracle java version “1.8.0”  
Java™ SE Runtime Environment (build 1.8.0-b132)  
Java HotSpot™ 64-Bit Server VM (build 25.0-b70, mixed mode)  
same effect present on java 1.7 too

Ignition: 7.6.6 (b2014040112)

Under linux you can count close\_wait socket with:

```auto
sudo lsof -iTCP -sTCP:CLOSE_WAIT|wc -l
```

On ignition restart all close\_wait sockets are released.

Same effect persist in the script playground window, but the sockets are on my workstation pc.

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [October 28, 2014, 3:49pm UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493/2 "2014-10-28T15:49:23Z")

</div>

Sorry for the late reply to this thread. This appears to be a bug that has been fixed in Jython 2.7. We are not able to update to this library as it is still in beta. We can update to this version when it becomes available. Our developers may have found a workaround for this issue by making a change to the suds library in the installation directory of Ignition. It is currently being ran through QA and will be added to the current build once we have ensured it corrects the close\_wait socket issue.

---

<div class="post-metadata">

**Author:** ![pdibenedetto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdibenedetto/32/6364_2.png) [@pdibenedetto](https://forum.inductiveautomation.com/u/pdibenedetto)\
**Post date:** [July 10, 2017, 5:05pm UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493/3 "2017-07-10T17:05:50Z")

</div>

Could you share this workaround?:

> [@greg.simpson](#):
>
> Our developers may have found a workaround for this issue by making a change to the suds library in the installation directory of Ignition. It is currently being ran through QA and will be added to the current build once we have ensured it corrects the close\_wait socket issue.

Regards

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [July 10, 2017, 5:36pm UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493/4 "2017-07-10T17:36:49Z")

</div>

Not sure what version of Ignition you are using, or if you were using SUDS previously, but we removed SUDS back in the 7.8.3 release of Ignition. However, if you were previously using SUDS then it should continue to work. Any other questions you have related to this topic should be treated as a new topic and a new thread started. Thanks

---

<div class="post-metadata">

**Author:** ![dustin.cooper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dustin.cooper/32/29963_2.png) [@dustin.cooper](https://forum.inductiveautomation.com/u/dustin.cooper)\
**Post date:** [June 12, 2018, 9:56pm UTC](https://forum.inductiveautomation.com/t/close-wait-sockets-when-using-web-services-suds/8493/5 "2018-06-12T21:56:17Z")

</div>

Apologize for resurrecting an old thread, but I'm experiencing the same issue in v7.9.4.

> [@SUDS Web Service Calls Gobbling up TCP Connections on Gateway](http://forum.inductiveautomation.com/t/suds-web-service-calls-gobbling-up-tcp-connections-on-gateway/18125):
>
> I have an application that connects to an SAP WSDL to create, cancel, and lookup inventory information. Ignition v7.9.4, using built-in SUDS libraries. I’m able to connect to the web service, and call all methods on the wsdl without issue, but I’m running into a problem with opening and hanging up TCP connections. I have a gateway timer script that runs once a minute. It opens a client once each time the script is called, then does a query for inventory units that have recently been created,…

I've tried the original SUDS that was installed with the gateway, as well as the jurko suds fork.

I'd be very much interested to see what workaround the devs may have come up with.
