jvliwanag/ejabberd_sockjs — pull request #1 by climvalencia (2013-11-21 05:54:28+00:00)
Title: Stop c2s PID on websocket 'close' event

I was running a few tests with Strophe and noticed that upon calling the Strophe Connection `disconnect()` function, ejabberd_sockjs receives a 'closed' event but does not do any application logic.

Some tests with dbg:
```erlang
(<0.554.0>) call ejabberd_sockjs:'-start_listener/2-fun-0-'({sockjs_session,{<0.554.0>,
[{peername,{{192,168,1,1},42400}},
{sockname,{{192,168,1,1},42400}},
{path,"/zsock/998/d0siysc3/websocket"},
{headers,[]}]}},closed,{sockjs_state,<0.555.0>})
(<0.554.0>) call ejabberd_sockjs:service_ej({sockjs_session,{<0.554.0>,
[{peername,{{192,168,1,1},42400}},
{sockname,{{192,168,1,1},42400}},
{path,"/zsock/998/d0siysc3/websocket"},
{headers,[]}]}},closed,{sockjs_state,<0.555.0>})
```

So far I've only seen the 'close' event when calling `disconnect()`. Are there other scenarios where this happens but the session should not be closed?