コード例 #1
0
        /// <summary>
        /// Creates a new hub response object for a hub caller context, if the connection is made by a forwarding hub.
        /// </summary>
        /// <param name="context"></param>
        public void CreateInstance(HubCallerContext context)
        {
            var originContext = context.GetOriginConnectionContext();

            if (originContext != null)
            {
                _responseHubCallerContexts.GetOrAdd(originContext.ConnectionId, new ResponseHubCallerContext(context));
            }
        }
コード例 #2
0
        public DotNetifyHubContext(HubCallerContext callerContext, string callType, string vmId, object data, object headers, IPrincipal principal)
        {
            CallerContext = callerContext;
            CallType      = callType;
            VMId          = vmId;
            Data          = data;
            Headers       = headers;
            Principal     = principal;

            ConnectionId = CallerContext.GetOriginConnectionContext()?.ConnectionId ?? CallerContext.ConnectionId;
        }