I know signal R maintain a different Context.ConnectionId
for each tab, I was testing a scenario when someone don't close the tab and enter different credentials. How can I tackle this problem for the context id to remain the same. I have a dictionary object in which Context.ConnectionId
is my key. Below is my code.
private static readonly Dictionary<string, ConnectionManger> connectionManagerDictonary = new Dictionary<string, ConnectionManger>();
public void Connect(string username, string password, string xmppDomain)
{
//check connection manager already exists or not
if (!connectionManagerDictonary.ContainsKey(Context.ConnectionId))
{
ConnectionManger connectionManager = new ConnectionManger();
connectionManager.OpenXmppConnection(5222, false, xmppDomain, username, password);
connectionManagerDictonary.Add(Context.ConnectionId, connectionManager);
}
}