4 implementations of IHubProtocol
Microsoft.AspNetCore.Components.Server (1)
BlazorPack\BlazorPackHubProtocol.cs (1)
16internal sealed class BlazorPackHubProtocol : IHubProtocol
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
24public sealed class JsonHubProtocol : IHubProtocol
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocol.cs (1)
20public class MessagePackHubProtocol : IHubProtocol
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
25public class NewtonsoftJsonHubProtocol : IHubProtocol
58 references to IHubProtocol
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ComponentServiceCollectionExtensions.cs (1)
61services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, BlazorPackHubProtocol>());
Microsoft.AspNetCore.SignalR.Client (1)
HubConnectionBuilderHttpExtensions.cs (1)
180public HubProtocolDerivedHttpOptionsConfigurer(IHubProtocol hubProtocol)
Microsoft.AspNetCore.SignalR.Client.Core (11)
HubConnection.cs (5)
79private readonly IHubProtocol _protocol; 203/// <param name="protocol">The <see cref="IHubProtocol" /> used by the connection.</param> 214public HubConnection(IConnectionFactory connectionFactory, IHubProtocol protocol, EndPoint endPoint, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, IRetryPolicy reconnectPolicy) 224/// <param name="protocol">The <see cref="IHubProtocol" /> used by the connection.</param> 232IHubProtocol protocol,
Internal\SerializedHubMessage.cs (3)
45/// <param name="message">The hub message for the cache. This will be serialized with an <see cref="IHubProtocol"/> in <see cref="GetSerializedMessage"/> to get the message's serialized representation.</param> 52/// Gets the serialized representation of the <see cref="HubMessage"/> using the specified <see cref="IHubProtocol"/>. 56public ReadOnlyMemory<byte> GetSerializedMessage(IHubProtocol protocol)
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
27private readonly IHubProtocol _protocol; 64public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger) 69public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger, TimeProvider timeProvider)
Microsoft.AspNetCore.SignalR.Common (7)
IInvocationBinder.cs (1)
11/// Class used by <see cref="IHubProtocol"/>s to get the <see cref="Type"/>(s) expected by the hub message being deserialized.
Protocol\HandshakeProtocol.cs (1)
49public static ReadOnlySpan<byte> GetSuccessfulHandshake(IHubProtocol protocol) => _successHandshakeData.Span;
Protocol\HubProtocolExtensions.cs (2)
9/// Extension methods for <see cref="IHubProtocol"/>. 19public static byte[] GetMessageBytes(this IHubProtocol hubProtocol, HubMessage message)
Protocol\InvocationBindingFailureMessage.cs (1)
10/// message that is sent on the wire, it is returned by <see cref="IHubProtocol.TryParseMessage"/>
Protocol\RawResult.cs (1)
14/// Type returned to <see cref="IHubProtocol"/> implementations to let them know the object being deserialized should be
Protocol\StreamBindingFailureMessage.cs (1)
13/// message that is sent on the wire, it is returned by <see cref="IHubProtocol.TryParseMessage"/>
Microsoft.AspNetCore.SignalR.Core (24)
HubConnectionContext.cs (1)
169public virtual IHubProtocol Protocol { get; set; } = default!;
HubConnectionHandler.cs (1)
266var protocol = connection.Protocol;
HubLifetimeManager.cs (1)
164/// Tells <see cref="IHubProtocol"/> implementations what the expected type from a connection result is.
HubOptionsSetup.cs (3)
30/// <param name="protocols">The list of <see cref="IHubProtocol"/>s that are from Dependency Injection.</param> 31public HubOptionsSetup(IEnumerable<IHubProtocol> protocols) 33foreach (var hubProtocol in protocols)
IHubProtocolResolver.cs (4)
9/// A resolver abstraction for working with <see cref="IHubProtocol"/> instances. 16IReadOnlyList<IHubProtocol> AllProtocols { get; } 23/// <returns>A matching <see cref="IHubProtocol"/> or <c>null</c> if no matching protocol was found.</returns> 24IHubProtocol? GetProtocol(string protocolName, IReadOnlyList<string>? supportedProtocols);
Internal\DefaultHubProtocolResolver.cs (8)
14private readonly List<IHubProtocol> _hubProtocols; 15private readonly Dictionary<string, IHubProtocol> _availableProtocols; 17public IReadOnlyList<IHubProtocol> AllProtocols => _hubProtocols; 19public DefaultHubProtocolResolver(IEnumerable<IHubProtocol> availableProtocols, ILogger<DefaultHubProtocolResolver> logger) 22_availableProtocols = new Dictionary<string, IHubProtocol>(StringComparer.OrdinalIgnoreCase); 24foreach (var protocol in availableProtocols) 32public IHubProtocol? GetProtocol(string protocolName, IReadOnlyList<string>? supportedProtocols) 36if (_availableProtocols.TryGetValue(protocolName, out var protocol) && (supportedProtocols == null || supportedProtocols.Contains(protocolName, StringComparer.OrdinalIgnoreCase)))
SerializedHubMessage.cs (3)
41/// <param name="message">The hub message for the cache. This will be serialized with an <see cref="IHubProtocol"/> in <see cref="GetSerializedMessage"/> to get the message's serialized representation.</param> 50/// Gets the serialized representation of the <see cref="HubMessage"/> using the specified <see cref="IHubProtocol"/>. 54public ReadOnlyMemory<byte> GetSerializedMessage(IHubProtocol protocol)
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
27private readonly IHubProtocol _protocol; 64public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger) 69public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger, TimeProvider timeProvider)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
JsonProtocolDependencyInjectionExtensions.cs (1)
38builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, JsonHubProtocol>());
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
MessagePackProtocolDependencyInjectionExtensions.cs (1)
41builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, MessagePackHubProtocol>());
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
NewtonsoftJsonProtocolDependencyInjectionExtensions.cs (1)
41builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, NewtonsoftJsonHubProtocol>());
Microsoft.AspNetCore.SignalR.Specification.Tests (3)
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\HubConnectionContextUtils.cs (1)
17public static HubConnectionContext Create(ConnectionContext connection, IHubProtocol protocol = null, string userIdentifier = null)
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (2)
29private readonly IHubProtocol _protocol; 41public TestClient(IHubProtocol protocol = null, IInvocationBinder invocationBinder = null, string userIdentifier = null, long pauseWriterThreshold = 32768)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (8)
Internal\DefaultHubMessageSerializer.cs (4)
11private readonly List<IHubProtocol> _hubProtocols; 16_hubProtocols = new List<IHubProtocol>(supportedProtocols.Count); 19var protocol = hubProtocolResolver.GetProtocol(protocolName, (supportedProtocols as IReadOnlyList<string>) ?? supportedProtocols.ToList()); 30foreach (var protocol in _hubProtocols)
RedisHubLifetimeManager.cs (4)
49/// <param name="hubProtocolResolver">The <see cref="IHubProtocolResolver"/> to get an <see cref="IHubProtocol"/> instance when writing to connections.</param> 62/// <param name="hubProtocolResolver">The <see cref="IHubProtocolResolver"/> to get an <see cref="IHubProtocol"/> instance when writing to connections.</param> 649IHubProtocol? protocol = null; 650foreach (var hubProtocol in _hubProtocolResolver.AllProtocols)