Reputation: 11816
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
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