8 types derived from HubMessage
Microsoft.AspNetCore.SignalR.Common (8)
289 references to HubMessage
Microsoft.AspNetCore.Components.Server (11)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (8)
28public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
41private HubMessage? ParseMessage(ref MessagePackReader reader, IInvocationBinder binder)
73private HubMessage CreateInvocationMessage(ref MessagePackReader reader, IInvocationBinder binder, int itemCount)
109private HubMessage CreateStreamInvocationMessage(ref MessagePackReader reader, IInvocationBinder binder, int itemCount)
139private HubMessage CreateStreamItemMessage(ref MessagePackReader reader, IInvocationBinder binder)
335public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
357public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
387private void WriteMessageCore(HubMessage message, ref MessagePackWriter writer)
Microsoft.AspNetCore.Components.Server.Tests (15)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (9)
230Assert.True(HubProtocol.TryParseMessage(ref data, new TestBinder(testData.Message), out var message));
255Assert.True(HubProtocol.TryParseMessage(ref data, new TestBinder(expectedMessage), out var message));
397HubProtocol.TryParseMessage(ref data, binder, out var message);
408var result = HubProtocol.TryParseMessage(ref data, binder, out var message);
450public HubMessage Message { get; }
453public MessageSizeTestData(string name, HubMessage message, int size)
499protected byte[] Write(HubMessage message)
533public HubMessage Message { get; }
535public ProtocolTestData(string name, HubMessage message, string binary)
Microsoft.AspNetCore.SignalR.Client.Core (15)
HubConnection.cs (6)
1201private async Task SendHubMessage(ConnectionState connectionState, HubMessage hubMessage, CancellationToken cancellationToken = default)
1263private async Task SendWithLock(ConnectionState expectedConnectionState, HubMessage message, CancellationToken cancellationToken, [CallerMemberName] string callerName = "")
1281private async Task<CloseMessage?> ProcessMessagesAsync(HubMessage message, ConnectionState connectionState, ChannelWriter<InvocationMessage> invocationMessageWriter)
1646while (_protocol.TryParseMessage(ref buffer, connectionState, out var message))
2291public ValueTask<FlushResult> WriteAsync(HubMessage message, CancellationToken cancellationToken)
2297public bool ShouldProcessMessage(HubMessage message)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (6)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
Microsoft.AspNetCore.SignalR.Common (9)
Microsoft.AspNetCore.SignalR.Common.Tests (49)
Internal\Protocol\JsonHubProtocolTests.cs (6)
54var ex = Assert.Throws<InvalidDataException>(() => JsonHubProtocol.TryParseMessage(ref data, binder, out var _));
92protocol.TryParseMessage(ref data, binder, out var message);
105JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
131Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
164Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
197Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
Internal\Protocol\JsonHubProtocolTestsBase.cs (18)
147protocol.TryParseMessage(ref data, binder, out var message);
196var ex = Assert.Throws<InvalidDataException>(() => JsonHubProtocol.TryParseMessage(ref data, binder, out var _));
207JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
223protocol.TryParseMessage(ref data, binder, out var message);
236Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
256JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
269var ex = Assert.Throws<InvalidDataException>(() => JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
280JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
295JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
307JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
320JsonHubProtocol.TryParseMessage(ref data, binder, out var message);
442Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var message));
474Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var hubMessage));
490Assert.True(JsonHubProtocol.TryParseMessage(ref data, binder, out var hubMessage));
515public HubMessage Message { get; }
520public JsonProtocolTestData(string name, HubMessage message, bool useCamelCase, bool ignoreNullValues, string json)
535public HubMessage Message { get; }
538public MessageSizeTestData(string name, HubMessage message, int size)
Internal\Protocol\MessagePackHubProtocolTestBase.cs (9)
230Assert.True(HubProtocol.TryParseMessage(ref data, new TestBinder(testData.Message), out var message));
255Assert.True(HubProtocol.TryParseMessage(ref data, new TestBinder(expectedMessage), out var message));
397HubProtocol.TryParseMessage(ref data, binder, out var message);
408var result = HubProtocol.TryParseMessage(ref data, binder, out var message);
450public HubMessage Message { get; }
453public MessageSizeTestData(string name, HubMessage message, int size)
499protected byte[] Write(HubMessage message)
533public HubMessage Message { get; }
535public ProtocolTestData(string name, HubMessage message, string binary)
Internal\Protocol\MessagePackHubProtocolTests.cs (5)
38HubProtocol.TryParseMessage(ref bytes, new TestBinder(typeof(DateTime)), out var hubMessage);
67HubProtocol.TryParseMessage(ref bytes, new TestBinder(typeof(DateTimeOffset)), out var hubMessage);
222Assert.True(HubProtocol.TryParseMessage(ref data, binder, out var message));
252Assert.True(HubProtocol.TryParseMessage(ref data, binder, out var hubMessage));
265Assert.True(HubProtocol.TryParseMessage(ref data, binder, out var hubMessage));
Microsoft.AspNetCore.SignalR.Core (20)
Microsoft.AspNetCore.SignalR.Microbenchmarks (13)
Microsoft.AspNetCore.SignalR.Protocols.Json (13)
Protocol\JsonHubProtocol.cs (13)
89public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
103public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
110public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
115private HubMessage? ParseMessage(ReadOnlySequence<byte> input, IInvocationBinder binder)
348HubMessage message;
516private void WriteMessageCore(HubMessage message, IBufferWriter<byte> stream)
728private static HubMessage BindCancelInvocationMessage(string? invocationId)
738private static HubMessage BindCompletionMessage(string invocationId, string? error, object? result, bool hasResult)
758private static HubMessage BindStreamItemMessage(string invocationId, object? item, bool hasItem)
773private static HubMessage BindStreamInvocationMessage(string? invocationId, string target,
796private static HubMessage BindInvocationMessage(string? invocationId, string target,
904private static HubMessage ApplyHeaders(HubMessage message, Dictionary<string, string>? headers)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (11)
Protocol\MessagePackHubProtocolWorker.cs (8)
28public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
41private HubMessage? ParseMessage(ref MessagePackReader reader, IInvocationBinder binder)
73private HubMessage CreateInvocationMessage(ref MessagePackReader reader, IInvocationBinder binder, int itemCount)
109private HubMessage CreateStreamInvocationMessage(ref MessagePackReader reader, IInvocationBinder binder, int itemCount)
139private HubMessage CreateStreamItemMessage(ref MessagePackReader reader, IInvocationBinder binder)
335public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
357public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
387private void WriteMessageCore(HubMessage message, ref MessagePackWriter writer)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (13)
Protocol\NewtonsoftJsonHubProtocol.cs (13)
79public bool TryParseMessage(ref ReadOnlySequence<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
102public void WriteMessage(HubMessage message, IBufferWriter<byte> output)
109public ReadOnlyMemory<byte> GetMessageBytes(HubMessage message)
114private HubMessage? ParseMessage(Utf8BufferTextReader textReader, IInvocationBinder binder)
338HubMessage message;
513private void WriteMessageCore(HubMessage message, IBufferWriter<byte> stream)
721private static HubMessage BindCancelInvocationMessage(string? invocationId)
731private static HubMessage BindCompletionMessage(string invocationId, string? error, object? result, bool hasResult)
751private static HubMessage BindStreamItemMessage(string invocationId, object? item, bool hasItem)
766private static HubMessage BindStreamInvocationMessage(string? invocationId, string target, object?[]? arguments, bool hasArguments, string[]? streamIds)
788private static HubMessage BindInvocationMessage(string? invocationId, string target, object?[]? arguments, bool hasArguments, string[]? streamIds)
927private static HubMessage ApplyHeaders(HubMessage message, Dictionary<string, string>? headers)
Microsoft.AspNetCore.SignalR.Specification.Tests (15)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (3)
Microsoft.AspNetCore.SignalR.Tests (69)
Internal\MessageBufferTests.cs (12)
37Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
62Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
103Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
137Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
186Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
231Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
263Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
300Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
344Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
380Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
424Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
471Assert.True(protocol.TryParseMessage(ref buffer, new TestBinder(), out var message));
Microsoft.AspNetCore.SignalR.Tests.Utils (21)