I plan to create a chat application, and I read that SignalR is one of the best technologies to apply.
I have seen examples of this, but they only have one chat.
I want to have some chats. The user will simply select one of these chats.
Although I'm new, I think you can create a single chat room in SignalR as follows:
<script type="text/javascript">
$(function () {
var connection = $.connection.communicator;
connection.receive = function (from, msg) {
$("#chatWindow").append("<li>" + from + ": " + msg + "</li>");
};
$.connection.hub.start();
$("#btnSend").click(function () {
connection.broadcast($("#txtName").val(), $("#txtMsg").val());
});
});
</script>
var connection = separate chat (I'm not sure)
So, if I have many connections (e.g. connection1, connection2, connection3 ....), can I have several chats?
Once again, I'm not sure if this is correct ... Please help me on how to implement some chats ...
(PS: I saw JABBR, but its code changes nose. Can you provide simple examples, please?)