# Closing a TCP Socket from Jython

**URL:** <https://forum.inductiveautomation.com/t/closing-a-tcp-socket-from-jython/32829>\
**Category:** Ignition\
**Created:** [March 5, 2020, 6:53am UTC](https://forum.inductiveautomation.com/t/closing-a-tcp-socket-from-jython/32829 "2020-03-05T06:53:57Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 5, 2020, 6:35pm UTC](https://forum.inductiveautomation.com/t/closing-a-tcp-socket-from-jython/32829/14 "2020-03-05T18:35:00Z")

</div>

> [@prafull\_j](#):
>
> which I am unable to capture in script

Separate problem with your syntax. See this:

> [@Catch IOException?](http://forum.inductiveautomation.com/t/catch-ioexception/18612/3):
>
> Consider using two except blocks, as jython’s standard Exception won’t catch pure java exceptions. Like so: import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: # java exception

---

_[View the full topic](https://forum.inductiveautomation.com/t/closing-a-tcp-socket-from-jython/32829)._
