Commit Graph

57 Commits

Author SHA1 Message Date
BrennanConroy e2a712a1cd
Add logging to HubConnectionHandlerTests (#3286) 2018-11-16 10:00:18 -08:00
BrennanConroy e78e3db6f4
Honor InherentKeepAliveFeature for server timeout (#2727) 2018-08-06 10:37:12 -07:00
BrennanConroy 651b39bc90 Revert "Merge branch 'master' into release/2.2"
This reverts commit 785200877a, reversing
changes made to 3d6e1e69fd.
2018-07-31 15:24:33 -07:00
Dylan Dmitri Gray 748e992865
Dygray/handshake versioning (#2520)
* set minor versions on the protocols
2018-07-05 16:42:42 -07:00
Andrew Stanton-Nurse 5b22616a63
Fix tests when running on non-US locale (#2501) 2018-06-15 15:19:00 -07:00
BrennanConroy 1c9607a1ed
Verify Verifiable spelling (#2114) 2018-04-22 21:33:57 -07:00
James Newton-King ddc905c219
Add VerifyNoErrorsScope (#1972) 2018-04-15 11:12:21 +12:00
David Fowler 4fe41dc6d0
Increase timeout of test (#2021)
- Seems like it was possible for the server timeout to happen *before* the invocation happened.
- Added logging to the test
2018-04-14 05:05:49 -07:00
James Newton-King e4d0f2980e
Microsoft.AspNetCore.SignalR.Client refactor (#2000) 2018-04-14 21:09:41 +12:00
David Fowler 3e69fdc4ad
Delegate disposable to the IConnectionFactory (#1999)
- Added DisposeAsync to the IConnectionFactory. It's responsible for disposing the connection after the pipe has closed.
- Added dispose callback to WithConnectionFactory
- Don't wait for poll request to end before unwinding from the transport
- Make sure all http requests are done before returning from StopAsync in both SSE and longpolling
2018-04-13 09:16:23 -07:00
David Fowler abe139ee16
Make the protocol and messages public (#1994)
* Move types to a .Protocol namespace
2018-04-13 01:53:41 -07:00
David Fowler 4a568e90d2
API review changes (#1992)
- Changed GetMessageBytes to return ReadOnlyMemory
- Make HandshakeProtocol.SuccessHandshakeData a readonly field
2018-04-13 00:25:02 -07:00
Ben Adams 8a3516284e Add GetMessageBytes to IHubProtocol (#1915) 2018-04-10 07:14:09 -07:00
David Fowler c1049b722d
The grand unification of ConnectionContext (#1895)
This change rationalizes the 2 very similar abstractions that exist in Connections.Abstractions, IConnection and ConnectionContext. It also introduces an IConnectionFactory to SignalR that is used to create a new ConnectionContext for a HubConnection.

- HubConnection just completes both ends of the transport pipe instead of calling DisposeAsync.
- Implemented ConnectionContext on HttpConnection and added HttpConnectionFactory
-  Updated tests
2018-04-07 16:19:01 -07:00
James Newton-King e7b84b753b
Refactor HubConnectionBuilder (#1830) 2018-04-04 21:19:13 +12:00
BrennanConroy 903a9ea6a0
Use IBufferWriter in IHubProtocol (#1791) 2018-03-30 17:30:08 -07:00
Andrew Stanton-Nurse 6b3a27e73c
Bedrock Renames (#1777) 2018-03-30 15:09:19 -07:00
David Fowler 19b9dca268
Change IHubProtocol interface to support partial parsing (#1745)
- These are the finishing touches before we disable batching on the
C# client and on the server. We're changing the IHubProtocol interface to
modify the input buffer with what was consumed. We're also changing it
to parse a single message at a time to be match what output writing does.
- Added TryParseResponseMessage and made it look like TryParseRequestMessage
2018-03-28 12:08:16 -07:00
Andrew Stanton-Nurse cfaa123eb8 IConnection refactoring (#1718)
- IConnection is now single-use and HubConnection creates a new instance
for reconnecting
- IConnection is just a Pipe now, no more events
2018-03-27 23:02:07 -07:00
David Fowler 2e63e5afe3
The rename games part 1 of many (#1696)
- React to rename of EndPoint to ConnectionHandler
- Rename UseSockets to UseConnections
- Rename MapEndPoint to MapConnectionHandler
- Rename HttpSocketOptions to HttpConnectionOptions
2018-03-22 22:35:55 -07:00
BrennanConroy a47e1051e8
Add protocol version to handshake (#1666) 2018-03-22 15:54:35 -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
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 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
BrennanConroy 5ade419c53
Fix flaky test (#1397) 2018-02-01 15:13:40 -08:00
Andrew Stanton-Nurse b61dc35ee6
fix #1199 by suppressing ODE in received callback (#1395) 2018-02-01 15:08:52 -08:00
Pawel Kadluczka 66ab939cff Making HttpConnection restartable (C#) (#1147)
🎉
2017-12-12 10:08:42 -08:00
Andrew Stanton-Nurse a8330067c4
Implement #1157 by adding client timeout for C# client (#1165) 2017-12-07 14:54:41 -08:00
Andrew Stanton-Nurse c1d2024864
Implement #1156 by having the server send Ping messages (#1161) 2017-12-04 14:43:27 -08:00
Andrew Stanton-Nurse cb3124be17
First pass at Keep Alive (#1119)
This adds the Ping message type and support for sending/receiving it in the Hub Protocols. It does not add the logic to transmit keep-alive frames.
2017-11-16 09:45:13 -08:00
Pawel Kadluczka 379160707f
Switching to new base64 APIs (#1127) 2017-11-16 09:20:40 -08:00
BrennanConroy 792745ad98 React to CoreFxLab packages (#998) 2017-11-13 15:05:35 -08:00
Mikael Mengistu 1a21fd49b1
Changing the Closed Event to be a Task (#1080) 2017-11-09 17:51:13 -08:00
Pawel Kadluczka 06475270ec
Actually throwing exceptions from SendAsync (#1084)
SendAsync was using InvokeCoreAsync code to send messages. In case of exception InvokeCoreAsync is blocking and returns a task to the user so they can await for the remote call to complete. Any exception thrown is caught and used to fail the task returned to the user. SendAsync does not return a special task to the user so re-using InvokeCore resulted in swallowing exceptions. While SendAsync is fire and forget it actually should throw if the message could not be send and it was not happening.

While adding tests it turned out we did not test cases where Invoke/SendAsync/StreamAsync were invoked before starting the connection and this resulted in a NullReferenceException. I also fixed that.
2017-11-03 13:15:11 -07:00
Mikael Mengistu 04d4da2987 Replace Received Event with OnReceived (#1006) 2017-10-18 17:10:51 -07:00
Mikael Mengistu 72514f3943 Removing the connected event (#989) 2017-10-05 11:12:18 -07:00
Pawel Kadluczka 126901a08f Adding default ctors for HubProtocols 2017-09-21 15:30:23 -07:00
Pawel Kadluczka 4ac8e786cf Adding HubConnectionBuilder 2017-09-07 10:04:42 -07:00
Pawel Kadluczka 0ebd33a25c Plumbing TransferMode on the client side 2017-07-14 10:45:28 -07:00
Mikael Mengistu 2597e52e53 Rename HubConnection Extension Methods from Invoke to InvokeAsync (#637) 2017-07-05 22:56:03 -07:00
David Fowler 0f4295f90e Make parsers stateless (#628)
* Make parsers stateless
- Changed parser input to ReadOnlySpan<byte> to ReadOnlyBuffer<byte>
2017-07-01 23:44:22 -07:00
Mikael Mengistu d68de2b5ea Make Client Side Event Handlers Async (#610) 2017-06-28 22:39:59 -07:00
David Fowler 6332e98d03 Remove Try from Write methods (#614)
- We write to a Stream so it should never fail (it could throw
but that's not new).
2017-06-28 21:53:23 -07:00
Pawel Kadluczka f8d91b54d4 MsgPack end-to-end
Plugging in MsgPack protocol
Adding negotiation message to hub protocol
2017-06-27 18:40:55 -07:00
David Fowler 41f54d001b Remove dependencies on a bunch of corefxlab things (#576)
* Remove dependencies on a bunch of corefxlab things
- Used Stream instead of IOutput
- Removed pipelines dependency in most places.
2017-06-22 09:23:52 -07:00
David Fowler 12917ef0e9 Re-layer the .NET Client into Http and non-Http (#544)
* Re-layer the .NET Client into Http and non-Http
- Moved IConnection to Sockets.Abstractions and removed
HttpConnection and TransportType dependency.
- Renamed Sockets.Client to Sockets.Client.Http
- Renamed Sockets.Common to Sockets.Common.Http
- Renamed Connection to HttpConnection
- Removed HTTP dependency from HubConnection
- Removed tests that were testing connection logic in HubConnection

#518
2017-06-09 08:58:54 -10:00
Pawel Kadluczka a14a0ab039 Adding structured negotiate 2017-06-06 15:53:21 -07:00
David Fowler 59a8f5f3b5 Simplify the JSON and protobuf protocols (#524)
- Remove message type and message format
- Updated tests
2017-06-06 07:18:23 -10:00