简体   繁体   中英

SignalR resolve client that called hub method

I have signalR Hub:

    public class ServerHub : Hub
    {
        public void AnnounceIncomingCall(string name, string message)
        {
            return;
        }

        public bool ExecuteCall(Guid callId, int from, int to)
        {
            return false;
        }
    }

Is there any way to resolve Client / Connection that called remotely method ExecuteCall ? I would like to do this inside this method to answer exaclty to Client that have broadcasted the call.

I'm looking for something like Clients.Current ?

You can use the Clients.Caller property to get hold of the calling client. For more information, see IHubCallerConnectionContext.Caller documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM