Storing User On Login then Pushing Data On Demand

后端 未结 2 2018
南笙
南笙 2021-02-06 19:06

So I\'m using SignalR, it\'s setup and working correctly on my Website.

Let\'s suppose user A logs in (I am using the Membership API). When A logs in I am calling the co

2条回答
  •  猫巷女王i
    2021-02-06 19:37

    Your app needs to store a mapping of SignalR client (connection) IDs to user ids/names. That way, you can look up the current SignalR client ID for user B and then use it to send a message directly to them. Look at the chat sample app at https://github.com/davidfowl/JabbR for an example of this.

提交回复
热议问题