Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxWebSocketChatServer tiny issue #55

Closed
atonamy opened this issue Mar 22, 2016 · 1 comment
Closed

RxWebSocketChatServer tiny issue #55

atonamy opened this issue Mar 22, 2016 · 1 comment
Labels

Comments

@atonamy
Copy link

atonamy commented Mar 22, 2016

In this file you have this piece of code:

private void ClientLeaves()
        {
            if (!String.IsNullOrWhiteSpace(_session.Room))
            {
                Broadcast(new { cls = "msg", message = _session.Nick + " leaves the room.", room = _session.Room, nick = "Server", timestamp = DateTime.Now.ToString("hh:mm:ss") });
                Broadcast(new { cls = "leave", room = _session.Room, nick = _session.Nick }, _session);
            }
        }

You have ro replace to this:

Broadcast(new { cls = "msg", message = _session.Nick + " leaves the room.", room = _session.Room, nick = "Server", timestamp = DateTime.Now.ToString("hh:mm:ss") }, _session);
Broadcast(new { cls = "leave", room = _session.Room, nick = _session.Nick }, _session);

Otherwise 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.

@vtortola
Copy link
Owner

Thanks!

vtortola added a commit that referenced this issue Mar 23, 2016
@vtortola vtortola added the bug label Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants