# Disconnecting RTSP publisher

**URL:** <https://community.wowza.com/t/disconnecting-rtsp-publisher/47722>\
**Category:** Wowza Developer Dojo\
**Created:** [November 17, 2016, 5:40pm UTC](https://community.wowza.com/t/disconnecting-rtsp-publisher/47722 "2016-11-17T17:40:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pst\_pst](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pst\_pst](https://community.wowza.com/u/pst_pst)\
**Post date:** [November 17, 2016, 5:40pm UTC](https://community.wowza.com/t/disconnecting-rtsp-publisher/47722/1 "2016-11-17T17:40:27Z")

</div>

Hello, I have a situation where I need to disconnect a publisher when some condition becomes true. I tried calling

```auto
RTPSession.shutdown()

```

in a plugin and this removes stream from the incoming stream list returned by REST API but the underlying TCP connection remains. Is there any way to close it?

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [December 29, 2016, 9:47pm UTC](https://community.wowza.com/t/disconnecting-rtsp-publisher/47722/2 "2016-12-29T21:47:29Z")

</div>

Hi,

You can try using the following code to shut down the underlying I/O session.

```auto
BaseIoSession ioSession = rtpSession.getIoSession();
if (ioSession != null)
  ioSession.close();

```

Michelle
