Microsoft.AspNet.SignalR.PersistentConnection.ProcessNegotiationRequest C# (CSharp) Метод

ProcessNegotiationRequest() приватный Метод

private ProcessNegotiationRequest ( Microsoft.AspNet.SignalR.HostContext context ) : System.Threading.Tasks.Task
context Microsoft.AspNet.SignalR.HostContext
Результат System.Threading.Tasks.Task
        private Task ProcessNegotiationRequest(HostContext context)
        {
            // Total amount of time without a keep alive before the client should attempt to reconnect in seconds.
            var keepAliveTimeout = _configurationManager.KeepAliveTimeout();
            string connectionId = Guid.NewGuid().ToString("d");
            string connectionToken = connectionId + ':' + GetUserIdentity(context);

            var payload = new
            {
                Url = context.Request.LocalPath.Replace("/negotiate", ""),
                ConnectionToken = ProtectedData.Protect(connectionToken, Purposes.ConnectionToken),
                ConnectionId = connectionId,
                KeepAliveTimeout = keepAliveTimeout != null ? keepAliveTimeout.Value.TotalSeconds : (double?)null,
                DisconnectTimeout = _configurationManager.DisconnectTimeout.TotalSeconds,
                ConnectionTimeout = _configurationManager.ConnectionTimeout.TotalSeconds,
                TryWebSockets = _transportManager.SupportsTransport(WebSocketsTransportName) && context.Environment.SupportsWebSockets(),
                ProtocolVersion = _protocolResolver.Resolve(context.Request).ToString(),
                TransportConnectTimeout = _configurationManager.TransportConnectTimeout.TotalSeconds,
                LongPollDelay = _configurationManager.LongPollDelay.TotalSeconds
            };

            return SendJsonResponse(context, JsonSerializer.Stringify(payload));
        }