c# - What determines the SignalR connectionID and how to set it manually -


i'm playing around signalr , wandering how signalr creates connectionid based on ip adress, device connect or else? , wether possible set id manually. let have database users give unique number, can use number connectionid?

kind regards

the signalr connection id generated guid. if you'd target users in more meaningful way data, found useful pass something client connection, such user id , other data database, along signalr hub , craft group based on provide. should 1:1 mapping if you're trying isolate users own identifiers.

you can overriding onconnected() in hub, , implementing this, map generated id own. can target these groups (remember, 1:1, emulating id selector) liking.


public override task onconnected() {     var user = new user()     {         id = context.querystring["id"]         name = context.querystring["name"]     }      groups.add(context.connectionid, user.id);      return base.onconnected(); } 

mapping signalr users connections goes more detail well.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -