Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit d94a33f

Browse files
committed
feedback and fix build error
1 parent 7dd5884 commit d94a33f

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

src/Microsoft.AspNetCore.SignalR.Client.Core/Internal/SignalRClientLoggerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public static void ErrorInvokingClientSideMethod(this ILogger logger, string met
290290

291291
public static void ResettingKeepAliveTimer(this ILogger logger)
292292
{
293-
_resettingKeepAliveTimer(logger);
293+
_resettingKeepAliveTimer(logger, null);
294294
}
295295
}
296296
}

src/Microsoft.AspNetCore.SignalR.Common/Internal/Protocol/HubProtocolConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
22
{
3-
internal static class HubProtocolConstants
3+
public static class HubProtocolConstants
44
{
55
public const int InvocationMessageType = 1;
66
public const int StreamItemMessageType = 2;

test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -646,12 +646,6 @@ public async Task KeepAliveBehaviorIsCorrect(TransportType transportType)
646646
await hubConnection.InvokeAsync("Echo", "foo");
647647
await Task.Delay(50);
648648
Assert.False(hubConnection.Closed.IsCompleted);
649-
650-
if (transportType != TransportType.LongPolling)
651-
{
652-
var ex = await Assert.ThrowsAsync<TimeoutException>(async () => await hubConnection.Closed.OrTimeout(milliseconds: 500));
653-
Assert.Equal("Server timeout elapsed without receiving a message from the server.", ex.Message);
654-
}
655649
}
656650
catch (Exception ex)
657651
{
@@ -660,13 +654,15 @@ public async Task KeepAliveBehaviorIsCorrect(TransportType transportType)
660654
}
661655
finally
662656
{
663-
try
657+
if (transportType == TransportType.LongPolling)
664658
{
665659
await hubConnection.DisposeAsync().OrTimeout();
666660
}
667-
catch (TimeoutException) when (transportType != TransportType.LongPolling)
661+
else
668662
{
669-
// Already observed this exception!
663+
// We should have timed out the other transports.
664+
var ex = await Assert.ThrowsAsync<TimeoutException>(async () => await hubConnection.Closed.OrTimeout(milliseconds: 500));
665+
Assert.Equal("Server timeout elapsed without receiving a message from the server.", ex.Message);
670666
}
671667
}
672668
}

test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ public async Task ConnectionNotTerminatedIfServerKeepsSending()
213213

214214
try
215215
{
216-
await connection.ReceiveJsonMessage(new { type = 6 });
216+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
217217
await Task.Delay(50);
218-
await connection.ReceiveJsonMessage(new { type = 6 });
218+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
219219
await Task.Delay(50);
220-
await connection.ReceiveJsonMessage(new { type = 6 });
220+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
221221
await Task.Delay(50);
222222

223223
Assert.False(hubConnection.Closed.IsCompleted);

test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
using System.Net.Http;
88
using System.Text;
99
using System.Threading;
10-
using System.Threading.Tasks;
1110
using System.Threading.Channels;
11+
using System.Threading.Tasks;
12+
using Microsoft.AspNetCore.SignalR.Client.Tests;
1213
using Microsoft.AspNetCore.SignalR.Tests.Common;
1314
using Microsoft.AspNetCore.Sockets;
1415
using Microsoft.AspNetCore.Sockets.Client;
1516
using Microsoft.AspNetCore.Sockets.Internal;
1617
using Moq;
1718
using Moq.Protected;
1819
using Xunit;
19-
using Microsoft.AspNetCore.SignalR.Client.Tests;
2020

2121
namespace Microsoft.AspNetCore.Client.Tests
2222
{

test/Microsoft.AspNetCore.SignalR.Tests/WebSocketsTransportTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Threading.Tasks;
65
using System.Threading.Channels;
6+
using System.Threading.Tasks;
77
using Microsoft.AspNetCore.SignalR.Tests.Common;
88
using Microsoft.AspNetCore.Sockets;
99
using Microsoft.AspNetCore.Sockets.Client;
1010
using Microsoft.AspNetCore.Sockets.Internal;
1111
using Microsoft.AspNetCore.Testing.xunit;
1212
using Microsoft.Extensions.Logging.Testing;
13+
using Moq;
1314
using Xunit;
1415
using Xunit.Abstractions;
15-
using Moq;
1616

1717
namespace Microsoft.AspNetCore.SignalR.Tests
1818
{

0 commit comments

Comments
 (0)