Commit Graph

48 Commits

Author SHA1 Message Date
Pawel Kadluczka cc42b0eaef Fixing a bug where cancellation could result in HubException
When the client cancels a streaming method the server would send an error completion. This was not correct because cancellation is not an error. We did not see this because our client ignores any messages for a given streaming invocation after sending a CancelInvokationMessage but other clients may want to drain messages before considering a streaming method canceled.
2017-11-01 20:20:43 -07:00
Mikael Mengistu 5ffb082acb Add Missing Await in Test (#1045) 2017-10-22 23:37:12 -07:00
Pawel Kadluczka 8d1d6d0300 Adding StreamCompletion message (C#) 2017-10-19 18:20:03 -07:00
BrennanConroy 8701baf73d Add negotiate timeout option to hub options (#1003) 2017-10-11 08:59:37 -07:00
BrennanConroy de2e0967c3 Adding CancelInvocation message (#979)
* For Streaming only. And C# client only.
2017-10-06 15:55:39 -07:00
ivankarpey 665f166d67 fix issue with incorrect user detection when Invoking for User (#747)
* fix issue with incorrect user detection when Invoking for User

* fix failed testcases

* use proper extension method to avoid potential null reference exception

* fix for channel name in redis version + follow SignalR team recommendations

* remove unncessary freespace

* remove whitespaces

* introduce IUserIdProvider to resolve user id

* Move IUserIdProvider from HubLifetimeManager to HubConnectionContext

* setting user id to connection context in hubendpoint
2017-10-06 11:58:18 -07:00
David Fowler 9df8d2f795 Remove the params argument from IClientProxy (#946)
* Remove the params argument from IClientProxy
- This allows passing arrays without having to explicitly ToArray() or AsEnumerable()
- Added overloads up to 10 arguments
- Added tests
2017-09-25 21:01:52 -07:00
Pawel Kadluczka 0267695656 Exceptions thrown during writing should close the connection
We need to close the connection if there is an exception when writing to the transport on the server side. Currently if an exception happens it leaves the connection in an unsable state - after the exception no messages from the server will be sent to the client because the writing loop is terminated. Ignoring the message could cause hangs on the client side since we can fail while writing a completion message. In this case if the client is awaiting the invocation it will hang because the task will never be completed.
2017-09-25 08:13:46 -07:00
Pawel Kadluczka 4db78685dc camelCasing objects serialized by JsonHubProtocol
Fixes: #859
2017-09-21 22:58:59 -07:00
Pawel Kadluczka ba25dee141 Enabling customizing serialization settings in MessagePack protocol 2017-09-21 15:30:23 -07:00
FTWinston a7fb243501 Added typed HubContext 2017-09-19 16:16:31 -07:00
David Fowler a93e4be82f Added Cancellation support (#897)
* Added Cancellation support
- Added ConnectionAbortedToken to the HubConnectionContext. This allows
arbitrary code to access a handle that represents the connection lifetime
without handling OnDisconnectedAsync on the hub itself.
- Expose Abort on HubConnectionContext to allow server side methods to
abort the connection.
- Use the Abort to stop the main loop when unexpected invocation errors happen.
- Use the connection aborted token as unsubscribe from the IObservable and to complete
the IAsyncEnumerator for streaming results.
2017-09-18 12:47:38 -07:00
BrennanConroy 393ab6a4f0 Add extension method to get HttpContext on HubConnectionContext (#849) 2017-09-11 16:55:32 -07:00
Mikael Mengistu 8ec2848646 AllExcept for Dynamic and Typed Hubs (#796) 2017-08-31 15:30:19 -07:00
BrennanConroy 978f5cebc0 Starting HubOptions (#743)
* Added JsonSerializerSettings
2017-08-23 15:30:08 -07:00
Nate McMaster 629dd34977 Upgrade to xunit 2.3.0-beta4 (#754)
Removes unused theory parameters
2017-08-23 10:02:15 -07:00
Mikael Mengistu d469cc3151 Clients Subset - AllExcept (#700) 2017-08-22 17:33:27 -07:00
BrennanConroy 345190e6a9 Add timeout to Negotiate (#736) 2017-08-18 15:51:01 -07:00
BrennanConroy b12451025f Exit OnConnected early if Negotiate fails (#733) 2017-08-17 23:34:45 -07:00
Pawel Kadluczka 29f9c54b86 Updating xUnit version 2017-08-10 19:00:31 -07:00
Mikael Mengistu 8cda36157f Change Read to ReadAsync (#702) 2017-08-09 16:35:44 -07:00
Mikael Mengistu 32ef3eb355 Hub<T> (#689) 2017-08-08 17:39:09 -07:00
Mikael Mengistu 8ba29b578d Dynamic Hub Change Part 2 (#644) 2017-07-14 15:54:31 -07:00
Pawel Kadluczka 2854e868ec Adding tests for SSE transport #413 2017-07-13 09:14:03 -07:00
David Fowler 595f783857 Features everywhere (#639)
* Features everywhere
- The goal here is to move things closer to the final design where
ConnectionContext represents a very low level primitive that represents
any connection like transport. As part of that change, we remove unnecessary
properties like User and move those into features. They temporarily live in the same
assembly but they are not required by ConnectionContext.
- Used features for Hubs instead of Metadata
- Metadata is no longer thread safe
2017-07-06 11:27:16 -07:00
Mikael Mengistu cfaa4b69d7 Dynamic Hub Work Part 1 (#636)
Getting rid of TClient
2017-07-05 22:55:16 -07:00
David Fowler f21f5039b2 Replace ConnectionContext with HubConnectionContext (#629)
* Replace ConnectionContext with HubConnectionContext
- The SocketDelegate implementation owns the transport pipe,
it's a single producer single consumer model. SignalR needs to support
multiple producers so that broadcast, return values and sending to individual
connections works. This change introduces a multi producer channel that is used
by all producers to copy data to the transport safely. This will make the move
to pipelines easier.
2017-07-03 17:44:28 -07:00
David Fowler d6f5e16f38 Support non blocking send on client (#603)
* Added support for non blocking sends on HubConnection
- Renamed Invoke to InvokeAsync
- Add support for non blocking send to TS client
- Add tests to make sure that non blocking sends don't send responses
2017-06-28 21:00:13 -07:00
BrennanConroy ef273b4796 Add authorization per hub method (#577) 2017-06-23 10:22:05 -07:00
BrennanConroy 3cabb6aeb1 Don't over-discover Hub methods (#511) 2017-06-12 14:26:33 -07:00
Mikael Mengistu 680c48d584 Change Group Add and Remove API (#522) 2017-06-06 21:50:34 -04:00
Andrew Stanton-Nurse 263dd0e4fe Fix #324 by adding streaming support to the server (#461) 2017-05-31 09:10:20 -07:00
David Fowler 9d9a52119e Progress towards splitting the layers (#473)
* Progress towards splitting the layers
- This is based on the work anurse did in anurse/endpoint-middleware-spike to
introduce a connection middleware pipeline that mimics much of our http
pipeline. The intent is that this layer will be generic enough to build both
SignalR and Kestrel on top of but we're not there yet. This change makes incremental
progress towards splitting apart sockets and http so that we can add the tcp transport
without breaking everything all at once.
- Created Microsoft.AspNetCore.Sockets.Abstractions where the primitives for
sockets live. That includes, ConnectionContext (formerly Connection), EndPoint,
ISocketBuilder, SocketDelegate, etc.
- ConnectionContext isn't in it's final form as yet, it still very closely mirrors
the original Connection object we had so that tests continue to pass.
- The HttpConnectionDispatcher doesn't know about EndPoint anymore, it just cares
about invoking the SocketDelegate.
- EndPointOptions has been removed as part of this change as it coupled http specific configuration
to the end point type. There's a new HttpSocketOptions that needs to be passed into MapSocket calls.
- Updated the tests to deal with the API changes.
2017-05-23 02:43:32 -07:00
Andrew Stanton-Nurse 991c1d8517 Implement new Hub Protocol (Part Deux) (#390)
* convert to new protocol
* removed InvocationDescriptorRegistry because we're not yet sure about custom protocols
* update SocialWeather sample
* Moving ts client to using new protocol
* make the functional tests a little easier to run on ctrl-f5
2017-05-09 12:24:58 -07:00
BrennanConroy 1da4e07fff Use common ObjectMethodExecutor (#440) 2017-05-07 10:05:21 -07:00
BrennanConroy 14d3f2bc9b Allow overridden methods on hubs (#334)
Allow overridden methods on hubs
2017-03-23 14:38:31 -07:00
Pawel Kadluczka 82cbda4a9a Making `OrTimeout` common (#193)
Making `OrTimeout` common
2017-02-13 12:38:34 -08:00
BrennanConroy 72e7b54dff Add TestClient to simplify test code 2017-02-01 15:53:44 -08:00
David Fowler eafbe74160 Fixed parameter count mismatch when invoking methods with wrong case (#162)
* Fixed parameter count mismatch when invoking methods with wrong case
- Hub methods were being tracked with 2 dictionaries, one for parameter names
the other for callbacks. This change introduces a single dictionary that stores
the hub name to a HubMethodDescriptor. That descriptor stores the parameter types
and method info for the bound hub method.
- The callback is now just an invoke method on the HubEndPoint itself.
- Added tests for case sensitivity in hub method names
2017-01-26 18:25:49 +00:00
Pawel Kadluczka fb4a99ffff Fixing test hangs, adding timeouts. (#149) 2017-01-24 15:51:58 -08:00
BrennanConroy aec52670b4 React to Channel API changes 2017-01-19 08:15:59 -08:00
David Fowler cd9ed9228a Remove streaming transport as a top level API (#110)
- Remove Streaming* classes from Sockets. The main
API will be channels based and streaming transports
will use the PipelineChannel (formerly FramingChannel) to
access messages.
- Added WriteAsync and ReadAsync to Connection and hid
the IChannelConnection from public API.
- Also fixed the fact that unknown methods caused server side
exceptions.
- Changed the consumption pattern to WaitToReadAsync/TryRead to avoid
exceptions.
- React to API changes
2017-01-11 04:01:49 -08:00
BrennanConroy 9dbb3742c8 Adding more tests 2017-01-10 16:27:23 -08:00
Andrew Stanton-Nurse d281cb72ea add "messaging" endpoints and transports
* Need a separate set of primitives to handle messaging
* Using Channels (not Pipelines!) to provide the data flow for messaging
* All transports are now "message" based transports
* Added an adaptor to convert message-based transports to serve
streaming endpoints
2017-01-09 16:01:08 -08:00
moozzyk 217f707456 Sorting out exceptions
Making sure that OnConnected/OnDisconnected events are invoked correctly (e.g. if invoking OnDisconnectedAsync on hub threw we would not call OnDisconnectedAsync on lifetime manager and therefore we would continue to use/track connections that were already closed)
2017-01-09 08:29:44 -08:00
moozzyk 8022afd3a2 Handling exceptions thrown on the server side
Addresses: #62
2016-12-26 22:39:48 -08:00
BrennanConroy d0961fe28a Fix CI 2016-12-06 08:48:59 -08:00
BrennanConroy 28e3c8331b Dispose Hubs from ActivatorUtilities 2016-12-05 15:40:01 -08:00