Commit Graph

222 Commits

Author SHA1 Message Date
Nate McMaster 7281bf90c0 Upgrade to VS 2017 (#176) 2017-02-02 12:54:23 -08:00
BrennanConroy 72e7b54dff Add TestClient to simplify test code 2017-02-01 15:53:44 -08:00
Mikael Mengistu 5def499323 Added Sockets.Common and connection level testing (#173)
*Moved IChannelConnection, ChannelConnection, Format and Message to the new Sockets.Common project.

* Adding Connection level tests.
2017-01-31 14:59:21 -08:00
Dan Kirkham b32d3ad4e1 Removed explicit capturing of "this" for lamdas (#167)
* Removed explicit capturing of "this" for lamdas

* Capture current Id when invoking connection
2017-01-31 13:47:14 -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
moozzyk c997ea8165 Converting pipelines to channels 2017-01-26 08:04:58 -08:00
moozzyk 1119bcf1b3 Sharing channel connections 2017-01-26 08:04:56 -08:00
David Fowler 05cc7792df Synchronize the background scan and closing of connections
- It was possible for the application to be torn down during
a background scan. When that happened, the timer would be disposed
before the end of the scan and would throw an ObjectDisposedException
when timer resumption happened. This change introduces a lock that avoids that
race.

Fixes #161
2017-01-26 07:50:29 +00:00
David Fowler 162cd1fc06 Handle misbehaving user code (#159)
* Handle misbehaving user code
- Execute EndPoint logic on a threadpool thread
- Turn synchronous exceptions into async ones to unify the
error handling
- Added tests
2017-01-25 23:45:43 +00:00
David Fowler 934f6a70d1 Various fixes in HttpConnectionDispatcher (#151)
- The connection state object is manipulated by multiple parties in a non thread safe way. This change introduces a semaphore that should be used by anyone updating or reading the connection state. 
- Handle cases where there's an active request for a connection id and another incoming request for the same connection id, sse and websockets 409 and long polling kicks out the previous connection (https://github.com/aspnet/SignalR/issues/27 and https://github.com/aspnet/SignalR/issues/4)
- Handle requests being processed for disposed connections. There was a race where the background thread could remove and clean up the connection while it was about to be processed.
- Synchronize between the background scanning thread and the request threads when updating the connection state.
- Added `DisposeAndRemoveAsync` to the connection manager that handles`DisposeAsync` throwing and properly removes connections from connection tracking.
- Added Start to ConnectionManager so that testing is easier (background timer doesn't kick in unless start is called).
- Added RequestId to connection state for easier debugging and correlation (can easily see which request is currently processing the logical connection).
- Added tests
2017-01-25 22:27:55 +00:00
Dan Kirkham acd1dc5e24 Fixed inconsistent single quotes (#154) 2017-01-25 09:43:02 -08:00
moozzyk 3ad8efb4ab Fixing test after getid to negotiate rename 2017-01-25 09:32:26 -08:00
David Fowler 9eb42cce2d Clean up disposal of connection state (#148)
* Clean up disposal of connection state
- Removed IDisposable and added a DisposeAsync method to ConnectionState
- Added ApplicationTask and TransportTask to ConnectionState as first class
properties so that it is easy to see (in a process dump or debugger) the
outstanding tasks that Sockets is keeping track of on a per connection basis.
2017-01-25 00:08:08 +00:00
Pawel Kadluczka fb4a99ffff Fixing test hangs, adding timeouts. (#149) 2017-01-24 15:51:58 -08:00
David Fowler a1c8d3d841 Fix the TS client to respect the new endpoint
- Seems like the ts client wasn't updated to use /negotiate instead
of /getid
2017-01-24 21:12:53 +00:00
David Fowler 1e957a9e5a Allow processing of incoming invocations in parallel (#143)
* Allow processing of other incoming invocations in parallel
- Don't wait on the response of an invocation to pick up
the next message from the channel.
- Unhandled exceptions should continue bubbling up correctly
2017-01-24 20:46:17 +00:00
Pranav K 354daa2ded Remove references to RazorTooling from ChatSample 2017-01-20 12:28:38 -08:00
Nate McMaster 3acdb58f57 React to aspnet/Scaffolding#383 2017-01-19 20:45:38 -08:00
BrennanConroy aec52670b4 React to Channel API changes 2017-01-19 08:15:59 -08:00
Mikael Mengistu b8b0c73222 Added Win7 and Win2008 skip for WebSockets testing 2017-01-18 16:15:12 -08:00
Pawel Kadluczka ac8a6c9f67 Adding infrastructure to write node (a.k.a. unit) tests for ts client (#129) 2017-01-18 13:25:23 -08:00
Andrew Stanton-Nurse 8b6c25ad86 Minor fix to transport protocol spec 2017-01-18 09:13:37 -08:00
Andrew Stanton-Nurse 7a27c5891c Describe transport protocols (#125)
Describe the protocols to be used by Long Polling and Server-Sent Events.
2017-01-18 09:04:52 -08:00
Andrew Stanton-Nurse 464077866c rename getid to negotiate (#124)
* rename getid to negotiate
* also change SSE and Long Polling to require a pre-established connection
* disallow changing transports mid-connection; return a 400 response if the user attempts to do so
2017-01-17 15:45:29 -08:00
BrennanConroy 3d5fc9493a Remove format from connect and only use it in /send 2017-01-17 11:32:27 -08:00
Mikael Mengistu 3bba46d4d3 More WebSockets testing (#100) 2017-01-12 15:59:53 -08:00
David Fowler 172a20c4ec Use WaitToWriteAsync(), TryWrite() in HubLifetimeManager(s) (#122) 2017-01-11 22:13:12 -08:00
Andrew Stanton-Nurse 20d8f1fca2 fix autobahn test app to be an app (#114)
* fix autobahn test app to be an app
* remove net46 version of autobahn conformance test, the autobahn suite doesn't need to be run twice...
* add appveyor and travis support for autobahn
2017-01-11 16:36:48 -08:00
David Fowler 8dc68cb798 Use TryRead and TryWrite (#113)
* Use TryRead and TryWrite
- Use TryWrite to avoid errors on channel close for /send requests
- Use TryRead until it returns false for all transports but long polling
2017-01-11 12:27:18 -08:00
Mikael Mengistu 5d374b7dbe Remove delays in HubConnectionTests 2017-01-11 10:10:38 -08:00
BrennanConroy b3df10b638 Use connections format 2017-01-11 10:07:15 -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
moozzyk a9c7e14da0 Making HttpClient configurable and reusable 2017-01-10 16:19:26 -08:00
David Fowler bd19022c4c Fixed teardown for streaming connections
- Added mega hack for cancellation until we get newer pipeline
implementations.
2017-01-10 14:32:10 -08:00
David Fowler baf7fce49d Made some fixes to the disconnect sequence
- Fixed ChannelConnection to use IChannel<T> for
both sides of the connection. This allows use to close both the
input and the output when we are tearing down.
- Use TryComplete instead of complete to avoid exceptions thrown on
Complete(), particularly ChannelClosedException.
2017-01-10 14:32:10 -08:00
BrennanConroy a9dfd83ff4 Fix EF.Tools version 2017-01-10 14:54:35 -08:00
moozzyk 8e2ba0fe87 Merge branch 'pawelka/chat' into dev 2017-01-10 14:01:44 -08:00
Andrew Stanton-Nurse 0af0318f43 fix rebase error
re-removed error handling from HubEndpoint, since HttpConnectionDispatcher handles it
2017-01-10 13:49:41 -08:00
moozzyk b18606ec8d Fixing chat sample - it was still using fully qualified hub method name 2017-01-10 11:41:47 -08:00
Stephen Halter b977c871ae Remove unnecessary explicit dependency 2017-01-10 00:14:09 -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 fa0219f75e Updating Social Weather sample to 1.2.0 2017-01-09 08:36:05 -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
Chris R 80c5f9be0e Remove unused WebListener reference 2017-01-03 22:08:24 -08:00
Pawel Kadluczka dbf27c30c3 Introducing HubActivator (#83)
Fixes #60
2016-12-30 11:42:02 -08:00
moozzyk 8022afd3a2 Handling exceptions thrown on the server side
Addresses: #62
2016-12-26 22:39:48 -08:00
moozzyk 3a01d6cff1 Introducing async/await in TS client + minor clean up 2016-12-26 22:23:39 -08:00
Ajay Bhargav Baaskaran b424e5b2b0 Updating shared runtime in missed test projects 2016-12-22 14:53:11 -08:00
Ajay Bhargav Baaskaran 12da346de9 Updating missed projects to 4.4 CoreFx packages 2016-12-22 14:37:42 -08:00