# Disconnecting HLS sessions takes very long

**URL:** <https://community.wowza.com/t/disconnecting-hls-sessions-takes-very-long/43124>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 27, 2014, 6:09pm UTC](https://community.wowza.com/t/disconnecting-hls-sessions-takes-very-long/43124 "2014-05-27T18:09:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mateusz\_Ko\_347\_lacz](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mateusz\_Ko\_347\_lacz](https://community.wowza.com/u/Mateusz_Ko_347_lacz)\
**Post date:** [May 27, 2014, 6:09pm UTC](https://community.wowza.com/t/disconnecting-hls-sessions-takes-very-long/43124/1 "2014-05-27T18:09:26Z")

</div>

After upgrading to the new version of Wowza, I’m ecountering some problems with disconnecting HLS client sessions from my module code. After calling methods described in api (in any configuration):

```auto
        session.shutdown();				
        session.rejectSession();		
        session.setAcceptSession(false);

```

stream still plays, and in Wowza log I can see strange stuff like:

```auto
INFO server comment - ServerHandler.exceptionCaught[[any]:1935:192.168.1.10]: java.io.IOException: An existing connection was forcibly closed by the remote host

```

and then stream is reconnected. Finally, stream stops, but it takes up to 2 minutes to disconnect, and obviously, I would like that to happen immediately.

Do you know what can cause that behaviour?

EDIT: I have managed to fix that. Due to fact, that HLS can open multiply http sessions, it’s necessary to do an authorization for each session. After disconnecting one of sessions because of expired authorization, player was reconnecting, and that next session wasn’t checked for authorization, so stream was still playing.

---

<div class="post-metadata">

**Author:** ![Tim\_Dougherty](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/tim_dougherty/32/596_2.png) [@Tim\_Dougherty](https://community.wowza.com/u/Tim_Dougherty)\
**Post date:** [May 28, 2014, 8:44am UTC](https://community.wowza.com/t/disconnecting-hls-sessions-takes-very-long/43124/2 "2014-05-28T08:44:42Z")

</div>

Mateusz,

It sounds like you have this figured out. Thank you for taking the time to post.

-Tim
