{"action":"closed","issue":{"url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/55","repository_url":"https://api.github.com/repos/vtortola/WebSocketListener","labels_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/55/comments","events_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/55/events","html_url":"https://github.com/vtortola/WebSocketListener/issues/55","id":142581958,"number":55,"title":"RxWebSocketChatServer tiny issue","user":{"login":"atonamy","id":5222190,"avatar_url":"https://avatars.githubusercontent.com/u/5222190?v=3","gravatar_id":"","url":"https://api.github.com/users/atonamy","html_url":"https://github.com/atonamy","followers_url":"https://api.github.com/users/atonamy/followers","following_url":"https://api.github.com/users/atonamy/following{/other_user}","gists_url":"https://api.github.com/users/atonamy/gists{/gist_id}","starred_url":"https://api.github.com/users/atonamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atonamy/subscriptions","organizations_url":"https://api.github.com/users/atonamy/orgs","repos_url":"https://api.github.com/users/atonamy/repos","events_url":"https://api.github.com/users/atonamy/events{/privacy}","received_events_url":"https://api.github.com/users/atonamy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T08:33:15Z","updated_at":"2016-03-23T14:56:07Z","closed_at":"2016-03-23T14:56:07Z","body":"In this [file](https://github.com/vtortola/WebSocketListener/blob/master/samples/RxWebSocketChat/RxWebSocketChatServer/ChatJoinMessageHandler.cs) you have this piece of code:\r\n```\r\nprivate void ClientLeaves()\r\n        {\r\n            if (!String.IsNullOrWhiteSpace(_session.Room))\r\n            {\r\n                Broadcast(new { cls = \"msg\", message = _session.Nick + \" leaves the room.\", room = _session.Room, nick = \"Server\", timestamp = DateTime.Now.ToString(\"hh:mm:ss\") });\r\n                Broadcast(new { cls = \"leave\", room = _session.Room, nick = _session.Nick }, _session);\r\n            }\r\n        }\r\n\r\n```\r\nYou have ro replace to this:\r\n```\r\nBroadcast(new { cls = \"msg\", message = _session.Nick + \" leaves the room.\", room = _session.Room, nick = \"Server\", timestamp = DateTime.Now.ToString(\"hh:mm:ss\") }, _session);\r\nBroadcast(new { cls = \"leave\", room = _session.Room, nick = _session.Nick }, _session);\r\n```\r\nOtherwise when you in the chat room and closing tab of the browser then session do not release correctly because it's trying to send message to inexistent connection. "}}