Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses issue #1155 for the forever transports.
While PersistentConnection.OnConnectedAsync is running we queue all writes to the response stream to prevent clients from prematurely indicating the connection has started. We keep the subscriber's receive loop running to allow the subscriber to continue processing commands and to prevent deadlocks caused by waiting on ACKs.
- Loading branch information
Showing
10 changed files
with
117 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/Microsoft.AspNet.SignalR.Tests.Common/Connections/AddGroupOnConnectedConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.AspNet.SignalR.FunctionalTests | ||
{ | ||
class AddGroupOnConnectedConnection : PersistentConnection | ||
{ | ||
protected override async Task OnConnectedAsync(IRequest request, string connectionId) | ||
{ | ||
await Groups.Add(connectionId, "test"); | ||
Thread.Sleep(TimeSpan.FromSeconds(1)); | ||
await Groups.Add(connectionId, "test2"); | ||
} | ||
|
||
protected override async Task OnReceivedAsync(IRequest request, string connectionId, string data) | ||
{ | ||
await Groups.Send("test2", "hey"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters