183 references to TransferFormat
ClientSample (1)
RawSample.cs (1)
40DefaultTransferFormat = TransferFormat.Text,
Microsoft.AspNetCore.Components.Server (2)
BlazorPack\BlazorPackHubProtocol.cs (2)
30public TransferFormat TransferFormat => TransferFormat.Binary;
Microsoft.AspNetCore.Connections.Abstractions (4)
Features\ITransferFormatFeature.cs (4)
12/// Gets the supported <see cref="TransferFormat"/>. 14TransferFormat SupportedFormats { get; } 17/// Gets or sets the active <see cref="TransferFormat"/>. 19TransferFormat ActiveFormat { get; set; }
Microsoft.AspNetCore.Http.Connections (12)
Internal\HttpConnectionContext.cs (5)
81SupportedFormats = TransferFormat.Binary | TransferFormat.Text; 82ActiveFormat = TransferFormat.Text; 203public TransferFormat SupportedFormats { get; set; } 205public TransferFormat ActiveFormat { get; set; }
Internal\HttpConnectionDispatcher.cs (6)
25TransferFormats = new List<string> { nameof(TransferFormat.Text), nameof(TransferFormat.Binary) } 32TransferFormats = new List<string> { nameof(TransferFormat.Text) } 39TransferFormats = new List<string> { nameof(TransferFormat.Text), nameof(TransferFormat.Binary) } 151connection.SupportedFormats = TransferFormat.Text;
Internal\Transports\WebSocketsServerTransport.cs (1)
228var webSocketMessageType = (_connection.ActiveFormat == TransferFormat.Binary
Microsoft.AspNetCore.Http.Connections.Client (24)
HttpConnection.cs (4)
200public async Task StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken = default) 208private async Task StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken) 304private async Task SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken) 518private async Task StartTransport(Uri connectUrl, HttpTransportType transportType, TransferFormat transferFormat,
HttpConnection.Log.cs (1)
59public static void TransportDoesNotSupportTransferFormat(ILogger logger, HttpTransportType transport, TransferFormat transferFormat)
HttpConnectionOptions.cs (4)
248/// Gets or sets the default <see cref="TransferFormat" /> to use if <see cref="HttpConnection.StartAsync(CancellationToken)"/> 249/// is called instead of <see cref="HttpConnection.StartAsync(TransferFormat, CancellationToken)"/>. 251public TransferFormat DefaultTransferFormat { get; set; } = TransferFormat.Binary;
Internal\ITransport.cs (1)
14Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default);
Internal\LongPollingTransport.cs (3)
43public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 45if (transferFormat != TransferFormat.Binary && transferFormat != TransferFormat.Text)
Internal\LongPollingTransport.Log.cs (1)
17public static partial void StartTransport(ILogger logger, TransferFormat transferFormat);
Internal\ServerSentEventsTransport.cs (2)
46public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 48if (transferFormat != TransferFormat.Text)
Internal\ServerSentEventsTransport.Log.cs (1)
17public static partial void StartTransport(ILogger logger, TransferFormat transferFormat);
Internal\WebSocketsTransport.cs (6)
287public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 291if (transferFormat != TransferFormat.Binary && transferFormat != TransferFormat.Text) 296_webSocketMessageType = transferFormat == TransferFormat.Binary 409await StartAsync(url, _webSocketMessageType == WebSocketMessageType.Binary ? TransferFormat.Binary : TransferFormat.Text,
Internal\WebSocketsTransport.Log.cs (1)
16public static partial void StartTransport(ILogger logger, TransferFormat transferFormat, Uri webSocketUrl);
Microsoft.AspNetCore.Http.Connections.Tests (12)
HttpConnectionDispatcherTests.cs (9)
1791[InlineData(HttpTransportType.ServerSentEvents, TransferFormat.Text)] 1792[InlineData(HttpTransportType.WebSockets, TransferFormat.Binary | TransferFormat.Text)] 1793public async Task TransferModeSet(HttpTransportType transportType, TransferFormat? expectedTransferFormats) 3271DefaultTransferFormat = TransferFormat.Text, 3332DefaultTransferFormat = TransferFormat.Text, 3433DefaultTransferFormat = TransferFormat.Text, 3472DefaultTransferFormat = TransferFormat.Text, 3546DefaultTransferFormat = TransferFormat.Text,
WebSocketsTests.cs (3)
74[InlineData(TransferFormat.Text, nameof(WebSocketMessageType.Text))] 75[InlineData(TransferFormat.Binary, nameof(WebSocketMessageType.Binary))] 76public async Task WebSocketTransportSetsMessageTypeBasedOnTransferFormatFeature(TransferFormat transferFormat, string expectedMessageType)
Microsoft.AspNetCore.SignalR.Client (1)
HubConnectionBuilderHttpExtensions.cs (1)
178private readonly TransferFormat _defaultTransferFormat;
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
HubConnectionTests.cs (1)
73private static Func<EndPoint, ValueTask<ConnectionContext>> GetHttpConnectionFactory(string url, ILoggerFactory loggerFactory, string path, HttpTransportType transportType, TransferFormat transferFormat)
HubProtocolVersionTests.cs (2)
110DefaultTransferFormat = TransferFormat.Text 212public TransferFormat TransferFormat => _protocol.TransferFormat;
VersionJsonHubProtocol.cs (1)
27public TransferFormat TransferFormat => _innerProtocol.TransferFormat;
Microsoft.AspNetCore.SignalR.Client.Tests (67)
HttpConnectionFactoryTests.cs (4)
34DefaultTransferFormat = TransferFormat.Text, 50Options.Create(new HttpConnectionOptions { DefaultTransferFormat = TransferFormat.Text }), 68DefaultTransferFormat = TransferFormat.Text 98{ $"{nameof(HttpConnectionOptions.DefaultTransferFormat)}", TransferFormat.Text },
HttpConnectionTests.cs (1)
37Assert.Equal(TransferFormat.Binary, httpOptions.DefaultTransferFormat);
HttpConnectionTests.Helpers.cs (4)
26TransferFormat transferFormat = TransferFormat.Text, 48TransferFormat transferFormat = TransferFormat.Text)
HttpConnectionTests.Negotiate.cs (6)
515.Returns(new TestTransport(transferFormat: TransferFormat.Text | TransferFormat.Binary)); 520CreateConnection(testHttpHandler, transportFactory: transportFactory.Object, loggerFactory: noErrorScope.LoggerFactory, transferFormat: TransferFormat.Binary), 564.Returns(new TestTransport(transferFormat: TransferFormat.Text | TransferFormat.Binary)); 567CreateConnection(testHttpHandler, transportFactory: transportFactory.Object, transferFormat: TransferFormat.Binary),
HttpConnectionTests.Transport.cs (3)
306CreateConnection(transport: transport, transferFormat: TransferFormat.Binary), 309await connection.StartAsync(TransferFormat.Text).DefaultTimeout(); 311Assert.Equal(TransferFormat.Text, transport.Format);
HubConnectionTests.cs (2)
989public TransferFormat TransferFormat => TransferFormat.Binary;
LongPollingTransportTests.cs (22)
50await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 83await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 141await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 171var exception = await Assert.ThrowsAsync<HttpRequestException>(() => longPollingTransport.StartAsync(TestUri, TransferFormat.Binary)); 204await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 261await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary).DefaultTimeout(); 303await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 349await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 382await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 433await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 499await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 570await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 581[InlineData(TransferFormat.Binary)] 582[InlineData(TransferFormat.Text)] 583public async Task LongPollingTransportSetsTransferFormat(TransferFormat transferFormat) 610[InlineData(TransferFormat.Text | TransferFormat.Binary)] // Multiple values not allowed 611[InlineData((TransferFormat)42)] // Unexpected value 612public async Task LongPollingTransportThrowsForInvalidTransferFormat(TransferFormat transferFormat) 668await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 689await longPollingTransport.StartAsync(TestUri, TransferFormat.Binary); 741var startTask = transport.StartAsync(TestUri, TransferFormat.Text);
ResponseUtils.cs (5)
75transferFormats = new[] { nameof(TransferFormat.Text), nameof(TransferFormat.Binary) } 83transferFormats = new[] { nameof(TransferFormat.Text) } 91transferFormats = new[] { nameof(TransferFormat.Text), nameof(TransferFormat.Binary) }
ServerSentEventsTransportTests.cs (15)
54new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 103new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 153new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 209new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 259new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 286new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 340new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 374var ex = await Assert.ThrowsAsync<ArgumentException>(() => sseTransport.StartAsync(new Uri("http://fakeuri.org"), TransferFormat.Binary).DefaultTimeout()); 382[InlineData(TransferFormat.Binary)] // Binary not supported 383[InlineData(TransferFormat.Text | TransferFormat.Binary)] // Multiple values not allowed 384[InlineData((TransferFormat)42)] // Unexpected value 385public async Task SSETransportThrowsForInvalidTransferFormat(TransferFormat transferFormat) 433await sseTransport.StartAsync(new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout(); 487new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout();
TestTransport.cs (4)
19public TransferFormat? Format { get; } 29public TestTransport(Func<Task> onTransportStop = null, Func<Task> onTransportStart = null, TransferFormat transferFormat = TransferFormat.Text) 36public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default)
WebSocketsTransportTests.cs (1)
33new Uri("http://fakeuri.org"), TransferFormat.Text).DefaultTimeout();
Microsoft.AspNetCore.SignalR.Common (1)
Protocol\IHubProtocol.cs (1)
29TransferFormat TransferFormat { get; }
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
DefaultHubDispatcherBenchmark.cs (1)
60public TransferFormat TransferFormat { get; }
RedisHubLifetimeManagerBenchmark.cs (1)
178public TransferFormat TransferFormat => _innerProtocol.TransferFormat;
RedisProtocolBenchmark.cs (2)
131public TransferFormat TransferFormat => TransferFormat.Text;
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
80public TransferFormat TransferFormat => TransferFormat.Text;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (2)
Protocol\MessagePackHubProtocol.cs (2)
33public TransferFormat TransferFormat => TransferFormat.Binary;
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
70public TransferFormat TransferFormat => TransferFormat.Text;
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (4)
37public TransferFormat SupportedFormats { get; set; } = TransferFormat.Text | TransferFormat.Binary; 39public TransferFormat ActiveFormat { get; set; }
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
DefaultHubMessageSerializerTests.cs (1)
143public TransferFormat TransferFormat => throw new NotImplementedException();
Microsoft.AspNetCore.SignalR.Tests (33)
AddSignalRTests.cs (1)
334public TransferFormat TransferFormat => throw new NotImplementedException();
EndToEndTests.cs (7)
66var connection = new HttpConnection(new HttpConnectionOptions { Url = new Uri(url), DefaultTransferFormat = TransferFormat.Text }, LoggerFactory, new TestTransportFactory()); 80var connection = new HttpConnection(new HttpConnectionOptions { Url = new Uri(url), Transports = transportType, DefaultTransferFormat = TransferFormat.Text }, LoggerFactory); 258public async Task ConnectionCanSendAndReceiveMessages(HttpTransportType transportType, TransferFormat requestedTransferFormat) 492DefaultTransferFormat = TransferFormat.Text, 719public Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 775yield return new[] { transport[0], TransferFormat.Text }; 779yield return new[] { transport[0], TransferFormat.Binary };
HubConnectionHandlerTests.cs (9)
285client.SupportedFormats = TransferFormat.Text; 315client.SupportedFormats = TransferFormat.Text; 345client.SupportedFormats = TransferFormat.Text; 388client.SupportedFormats = TransferFormat.Text; 427client.SupportedFormats = TransferFormat.Text; 2460client.SupportedFormats = TransferFormat.Binary; 2498client.SupportedFormats = TransferFormat.Binary; 2522client.SupportedFormats = TransferFormat.Binary; 3896testProtocol.Setup(m => m.TransferFormat).Returns(TransferFormat.Binary);
WebSocketsTransportTests.cs (16)
48TransferFormat.Binary).DefaultTimeout(); 81await webSocketsTransport.StartAsync(new Uri("http://FakeEndpot.com/echo"), TransferFormat.Binary).DefaultTimeout(); 96TransferFormat.Binary).DefaultTimeout(); 110TransferFormat.Binary).DefaultTimeout(); 141TransferFormat.Binary).DefaultTimeout(); 164TransferFormat.Binary); 172[InlineData(TransferFormat.Text)] 173[InlineData(TransferFormat.Binary)] 174public async Task WebSocketsTransportStopsWhenConnectionClosedByTheServer(TransferFormat transferFormat) 194[InlineData(TransferFormat.Text)] 195[InlineData(TransferFormat.Binary)] 196public async Task WebSocketsTransportSetsTransferFormat(TransferFormat transferFormat) 211[InlineData(TransferFormat.Text | TransferFormat.Binary)] // Multiple values not allowed 212[InlineData((TransferFormat)42)] // Unexpected value 214public async Task WebSocketsTransportThrowsForInvalidTransferFormat(TransferFormat transferFormat)
Microsoft.AspNetCore.SignalR.Tests.Utils (6)
DummyHubProtocol.cs (2)
21public TransferFormat TransferFormat => TransferFormat.Text;
TestClient.cs (4)
37public TransferFormat SupportedFormats { get; set; } = TransferFormat.Text | TransferFormat.Binary; 39public TransferFormat ActiveFormat { get; set; }
SocialWeather (1)
PersistentConnectionLifeTimeManager.cs (1)
30transferFormatFeature.ActiveFormat = TransferFormat.Binary;