Commit Graph

527 Commits

Author SHA1 Message Date
David Fowler 7df5c87815 Add copyright headers to new files 2018-03-18 15:39:20 -07:00
David Fowler b792fcb4ef
Reduce the per message read allocations (#1635)
- Introduced Utf8BufferTextReader that writes buffers directly into
the char[] allocated by JSON.NET when reading via the JsonReader.
- Use IArrayPool implementation over ArrayPool<char> when reading
incomming messages.
- Replaced JToken parsing with manual parsing using JsonTextReader.
- Added tests for parsing incoming JSON messages with out of order
properties.
- Make access to message headers lazy
- Changed IHubProtocol.TryParseMessage to be ReadOnlyMemory<byte> instead of ReadOnlySpan<byte>
2018-03-18 15:16:03 -07:00
BrennanConroy db0dc0f960
Ignore writeasync failures when sending to multiple connections (#1589) 2018-03-16 16:48:05 -07:00
BrennanConroy 0e38ee3e63
Create connectionIds using RNGCrypto (#1606) 2018-03-16 16:16:34 -07:00
David Fowler 079a56be1a
Small optimizations (#1617)
- Return ValueTask instead of Task from WriteAsync helpers
- Use TryGet instead of foreach to avoid enumerator (though it's just a stack allocation here)
2018-03-16 16:08:11 -07:00
BrennanConroy c640f422e0
Pascal case formatted log parameter names (#1615) 2018-03-16 12:13:27 -07:00
BrennanConroy 9839e6b07b
Perf in MessageParsers (#1616) 2018-03-16 11:40:15 -07:00
David Fowler 227c6b8133
Use the array unpacker instead of the Stream unpacker (#1619)
- This reduces allocations and improves throughout of msgpack
2018-03-16 09:41:34 -07:00
James Newton-King 2d6077db4a
Removed params from proxy's SendAsync and rename to SendCoreAsync (#1605) 2018-03-16 14:05:22 +13:00
David Fowler d27844dfef
ConnectionMetadata is now ConnectionItems (#1604)
* ConnectionMetadata is now ConnectionItems
2018-03-14 20:57:40 -07:00
Andrew Stanton-Nurse 2b68db873a
add AddRedis overload that takes connection string (#1588) 2018-03-14 16:24:28 -07:00
David Fowler 6a8ede0770
Further making Microsoft.AspNetCore.Sockets "not a thing" (#1599)
- This PR attempts to move things where they are needed instead of where they
happened to be used. As a result we should now have Sockets.Abstractions and
Sockets down to the minimal set of things required to make them run.
Sockets.Abstractions should go away in favor of Protocol.Abstractions and
Sockets contains the EndPoint abstraction and related types.
- Moved ConnectionManager and friends to
Sockets.Http.
-Removed Sockets and moved everything into Sockets.Abstractions.
- Moved DefaultConnection and put it in Sockets.Abstractions.
2018-03-14 15:37:24 -07:00
David Fowler dc0567690d
Use features from Protocol.Abstractions (#1594)
- This is part of the grand unification of the connection layer between SignalR and Kestrel
2018-03-14 08:17:07 -07:00
BrennanConroy 62956530ae
Rename StreamAsync to StreamAsChannelAsync (#1587) 2018-03-13 15:04:11 -07:00
Andrew Stanton-Nurse fb6121399c
Remove support for binary over SSE and add transfer format to negotiation (#1564) 2018-03-13 14:29:32 -07:00
David Fowler adb760210d
Minimal reaction to proto abstractions changes (#1583)
- Doesn't consume new feature interfaces yet.
2018-03-13 10:24:08 -07:00
James Newton-King 974eb28b8b
Hub method reflection caching and invocation benchmarks (#1574) 2018-03-13 10:30:45 +13:00
James Newton-King d816c6ef60
Add additional properties to HttpOptions (#1557) 2018-03-13 09:46:34 +13:00
BrennanConroy 489bd80b88
Remove threshold from client SSE pipe (#1577) 2018-03-12 12:50:42 -07:00
Mikael Mengistu 0b81658850
Add SignalR Marker Service (#1573) 2018-03-10 00:58:57 +00:00
James Newton-King d6178f2482
Fixed streaming hub method with ValueTask (#1572) 2018-03-10 12:31:38 +13:00
BrennanConroy d941a4be09
Workaround automatic Http2 upgrade in POSTs (#1571) 2018-03-09 11:43:59 -08:00
Pavel Krymets 4a4efe0f39
Update to new corefx (#1561) 2018-03-08 14:23:20 -08:00
Mikael Mengistu adbd964efd
Transport Fallback (#1455) 2018-03-08 06:49:03 +00:00
James Newton-King a41bf6228f
Client sends user agent with version based on assembly version (#1551) 2018-03-08 10:25:12 +13:00
James Newton-King 1c44e8febf
Fix streaming hub methods combined with async (#1544) 2018-03-07 20:07:06 +13:00
Mikael Mengistu 1b9313287b
Restrict HubProtocol on Server + HubOptions<THub> (#1492) 2018-03-07 01:31:56 +00:00
James Newton-King 846432c9ac
Improve unexpected server error message to client (#1532)
* Improve unexpected server error message to client

* Separated expected vs unexpected errors in error message. Fixed broken tests

* Fix ts functional tests
2018-03-06 22:11:46 +13:00
BrennanConroy 569c31bc62
Add some more logging (#1510) 2018-02-28 14:11:59 -08:00
Pavel Krymets 8908eec6e7
Pipelines in corefx (#1501) 2018-02-28 12:42:01 -08:00
Andrew Stanton-Nurse 13b25ec518
Reduce detailed payload logs to trace (#1515) 2018-02-28 10:46:44 -08:00
BrennanConroy 1790d6bdf0
Serialize once per format to increase perf in broadcasting scenarios (#1498) 2018-02-27 14:55:00 -08:00
BrennanConroy 8594d2b897
Use Threadpool for pipe scheduler (#1497) 2018-02-26 14:07:46 -08:00
David Fowler b60e4cfea6
Removing remnants from the days of OPTIONS (#1495) 2018-02-26 14:05:55 -08:00
Mikael Mengistu 0e4731e480
Expose Transport and Application Max Buffer Sizes (#1473) 2018-02-25 08:47:14 +00:00
Andrew Stanton-Nurse 6a2d41cc9f
Fix #924 by introducing HubDispatcher abstraction (#1479) 2018-02-22 20:59:34 -08:00
David Fowler 32baa655b9
Do over the websocket transport (#1481)
* Do over the websocket transport
- Unify client and server logic (no code sharing yet)
- Removed use of cancellation tokens to communicate shutdown and instead used the pipe reader and socket abort.
- Added CloseTimeout to HttpOptions
2018-02-22 15:19:25 -08:00
David Fowler c8d4cf689f
Tackling some low hanging performance fruit (#1470)
* Tackling some low hanging performance fruit
- Use native Memory/Span APIs on Stream and WebSocket in .NET Core 2.1
- Remove double copying in formatters
- Implemented custom HttpContent over ReadOnlyBuffer<byte>
2018-02-20 13:50:31 -08:00
David Fowler a2ac9c573e
Added try finally to semaphore release (#1469) 2018-02-18 12:37:42 -08:00
David Fowler e1bb2215e5
Remove the Channel<HubMessage> from the HubConnectionContext (#1468)
* Remove the Channel<HubMessage> from the HubConnectionContext
- Replace the channel with a single lock around the pipewriter. Since writes are always synchronous, the lock is held for a very short time.
- We were only using them in this scenario for handling multiple producers (the hub output, the keep alive ping and the broadcast).
- Handle the scenario where there's back pressure (when we use pipes that are bounded) and give callers a single task representing when back pressure is released.
- Handle synchronous exceptions in RedisHubLifetimeManager
- Fixed benchmarks
2018-02-17 10:22:11 -08:00
David Fowler de7faec246
Pass the array segment offset to WriteAsync (#1467) 2018-02-17 01:26:07 -08:00
BrennanConroy 3acd29ec6f Revert "Fix flaky SSE test (#1279)"
This reverts commit 6fcf554c23.
2018-02-16 19:01:54 -08:00
BrennanConroy a513386f68
Somehow the token didn't get passed into the reader (#1465) 2018-02-16 16:23:15 -08:00
BrennanConroy 6fcf554c23
Fix flaky SSE test (#1279) 2018-02-15 09:56:02 -08:00
Dona278 551158c239 Fixed exception during deserialization of a message with Redis (#1426)
Changed wrong message type used during deserialization in "SubscribeToUser"
2018-02-14 11:30:32 -08:00
BrennanConroy d9b32ee323
Logging invocations with errors would throw inside logger (#1445) 2018-02-13 14:57:21 -08:00
David Fowler ae998ba172
Remove unneeded dependencies (#1443) 2018-02-12 23:58:44 -08:00
David Fowler 6c22f25818
Client pipelines (#1435)
- Reworked the Client to be based on pipelines instead of Channels
- SendAsync no longer fails if the http request itself fails but the connection is closed as a result.
- Updated tests
- Base64Encoder needed to support multiple messages in the same span of data
2018-02-12 22:27:43 -08:00
David Fowler 3934ffd5af
Cleanup some dead code (#1434)
- Rename SocketBuilder to ConnectionBuilder
- Removed ChannelReaderExtensions
2018-02-10 22:16:30 -08:00
David Fowler 4c08acd8a4
Don't allocate all the memory up front when receiving incoming sends (#1433) 2018-02-10 20:52:00 -08:00