raberana
raberana

Reputation: 11816

signalr chat rooms

i am trying to create a chat application and i've read that signalr is a good thing to use. i looked for examples of it and so far, i've done this:

<script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR.min.js" type="text/javascript"></script>

 <script type="text/javascript">
    $(function () {
        var connection = $.connection('echo');

        connection.received(function (data) {
            $('#messages').append('<li>' + data + '</li>');
        });

        connection.start();

        $("#broadcast").click(function () {
            connection.send($('#msg').val());
        });
    });
</script>
<input id="msg">
<input id="broadcast" type="button">
<ul id="messages"></ul>

this only creates a single connection. i want to create multiple chat rooms, how can i make another connection and store those connections, lets say, in a database so i can have a record of those connections.

Upvotes: 1

Views: 1859

Answers (2)

Ilya Builuk
Ilya Builuk

Reputation: 2179

The great example of web-based chat using signalr and ASP.NET MVC is http://jabbr.net. It has chatrooms, commands, smiles and other useful features. Just explore its source code which is available here: https://github.com/davidfowl/JabbR

Upvotes: 1

Wim
Wim

Reputation: 1985

I don't think you need multiple connctions, but for a great example you can check out jabbr.net on gitHub an opensource chatapplication build with signalR and created by the same person that created SignalR.

Upvotes: 1

Related Questions