Commit Graph

105 Commits

Author SHA1 Message Date
David Fowler 2aabce48b4 Remove custom routing and path matching from HttpConnectionDispatcher (#471)
- We're now using the routing system in a very vanilla way now that
we're not using the URL space as part of the protocol.
- Removed the path argument from the HttpConnectionDispatcher (simplifies code and removes duplication from tests)
2017-05-20 00:34:29 -07:00
David Fowler 240a88f7af Make the http end points more resty (#470)
- Use HTTP verbs to describe functionality for endpoints
- Updated TransportProtocols.md
2017-05-19 23:37:17 -07:00
Nate McMaster ef7a3514cd Upgrade test framework versions and fix test issues (#453) 2017-05-15 12:50:30 -07:00
Andrew Stanton-Nurse ca9a44afc3 Merge branch 'rel/2.0.0-preview1' into dev 2017-05-04 14:11:16 -07:00
Mikael Mengistu 7f64811ccd Change targets (#437)
Target netcoreapp2.0
2017-05-04 14:05:58 -07:00
moozzyk 82f99a1424 Work around for a Firefox bug
Firefox won't fire EventSource open event until it receives some data. The workaround is to send an empty comment when starting ServerSentEvent transport.

Fixes: #352
2017-04-27 10:34:47 -07:00
moozzyk e691e1cff8 Removing legacy raw format for `send`
Fixes issues #383 and #127
2017-04-18 11:34:43 -07:00
BrennanConroy 9993fd96da Use policy names in EndPointOptions (#340) 2017-04-11 12:35:31 -07:00
David Fowler 0546dc21f4 Disable response buffering via the IHttpBufferingFeature (#379)
* Disable response buffering via the IHttpBufferingFeature
- To make sure SignalR works with servers and middleware
that do perform response buffering, disable it via the
IHttpBufferingFeature for SSE.
- Added test to verify buffering is disabled
2017-04-10 19:05:06 -07:00
David Fowler 5df022df0c Remove skipped tests and increased timeout for failing test 2017-04-04 22:13:12 -07:00
David Fowler 3b8e1a5380 Added a close timeout to the web socket transport
- Today we don't end the request if the application completes
but the websocket transport hasn't gotten the receive frame as yet.
This changes adds a WebSocketOptions.CloseTimeout to EndPointOptions
that allows configuring this timeout. When the timeout is reached, we abort
the connection and end the transport task so that the request can end.
- Added tests for websocket timeout and skipped tests for application timeouts
2017-04-04 09:59:41 -07:00
David Fowler 87e6da6e4c Handle exceptions and Cancellation in DisposeAsync (#366) 2017-04-03 22:21:41 -07:00
David Fowler 8da2dddd49 Fix issue where multiple calls to dispose don't wait properly (#360)
* Fix issue where multiple calls to dispose don't wait properly
- DisposeAsync returned immediately to anyone but the first caller.
This means that it was possible to end the request before properly
waiting on the transport task which means writing after dispose was possible.
- Added a test
2017-04-03 15:25:45 -07:00
BrennanConroy 6130003193 Convert to netcoreapp2.0 (#338)
* Converted samples and test projects to run on netcoreapp2.0
2017-03-25 09:37:39 -07:00
David Fowler 10782d59a2 Dev gate (#326)
* React to corefxlab
2017-03-21 08:48:32 -07:00
David Fowler 63ce7f6160 Supported transports (#294)
Supported transport spike
- Allow turning transports on or off per end point with a flags enum
- Added `TransportType` to Sockets.Common
- Added tests
2017-03-20 12:23:00 -07:00
Andrew Stanton-Nurse ab3dce85fc tidy up status codes and transport conflicts (#306) 2017-03-20 09:48:15 -07:00
Andrew Stanton-Nurse 1732ac5760 add support for binary format in /poll (#303) 2017-03-16 11:06:26 -07:00
Andrew Stanton-Nurse 0133153bc9 use new protocol for '/send' (#297) 2017-03-15 18:03:23 -07:00
Andrew Stanton-Nurse 78dfd278c1 Integrating new transport protocols (#257) 2017-03-07 10:46:36 -08:00
BrennanConroy 485f9595e2 EndPoint options and injection 2017-03-01 14:38:50 -08:00
BrennanConroy 0abac4a20d Fix null ref in DisposeAsync on ConnectionState 2017-02-28 11:44:25 -08:00
Nate McMaster af5e7da478 Remove workarounds and unify dependency versions 2017-02-23 17:09:07 -08:00
Andrew Stanton-Nurse 9767dbd5c1 fix #209 by converting to byte[] (#229)
* fix #209 by converting to byte[]
2017-02-22 11:50:37 -08:00
Pawel Kadluczka 763d115b08 Re-enabling building for net46 after System.Memory packages were fixed (#228) 2017-02-22 09:04:09 -08:00
Andrew Stanton-Nurse 755ba7613e Fix #215 and restore tests (#218)
* fix #215 by properly handling pipe closure

* pr feedback

* pr feedback
2017-02-21 15:27:52 -08:00
Nate McMaster 7e8f92b418 Remove makefile.shade and add npm install to repo.targets
Also, add (commented-out) conditional cross compiling for tests on xplat
2017-02-17 10:07:09 -08:00
moozzyk 607445fc2b Workaround for broken System.Memory package 2017-02-16 12:41:09 -08:00
moozzyk ce4a8f0276 Disabling tests broken by new pipelines 2017-02-16 12:40:23 -08:00
Nate McMaster f684fcb574 Downgrade to stable packages 2017-02-15 14:23:11 -08:00
Andrew Stanton-Nurse a728e1da41 Text Protocol Formatter (#187) 2017-02-14 16:00:51 -08:00
Nate McMaster 7281bf90c0 Upgrade to VS 2017 (#176) 2017-02-02 12:54:23 -08:00
moozzyk c997ea8165 Converting pipelines to channels 2017-01-26 08:04:58 -08: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
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
BrennanConroy aec52670b4 React to Channel API changes 2017-01-19 08:15:59 -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
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
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
Pranav K 1492b41af0 Updating to 4.4 CoreFx packages 2016-12-21 22:57:01 -08:00
David Fowler 5f3c1060ab Clean up shutdown management (#59)
* Clean up shutdown management
- ConnectionManager now implements IApplicationEvents. It makes testing cleaner
but makes service registration a little messy.

* Cleaned up service registration and layering a bit
- Added SocketsApplicationLifetimeEvents instead of implementing it
on ConnectionManager directly.
- Exposed ConnectionManager.CloseConnections()
2016-12-05 22:07:19 -08:00
BrennanConroy 7c8eeb11f4 Can't use project references in tests for the CI 2016-11-30 15:06:04 -08:00
BrennanConroy a96370ea35 Update project.json versions 2016-11-30 12:20:33 -08:00
David Fowler 1b59fc6f80 DI enabled Microsoft.AspNetCore.Sockets (#47)
* DI enabled Microsoft.AspNetCore.Sockets
- Added AddSockets extension method to IServiceCollection
- Inject IApplicationLifetime into ConnectionManager to handle
graceful shutdown and added test.
- Call AddSockets from AddSignalR

* PR feedback
- Added AddSignalR overload that takes Action<SignalROptions>
2016-11-26 23:09:38 -08:00
Andrew Stanton-Nurse 940ccf5c65 add tests to WebSockets transport (#35)
* add tests to WebSockets transport
* adds some error handling
* make logger factory required
* allow frames to be received after the application closes the output
2016-11-23 11:26:12 -08:00
David Fowler 4aa65cf0bf Updated to new System.IO.Pipelines package instead of Channels 2016-11-15 21:46:18 -08:00
Andrew Stanton-Nurse 2431c5925c integrate Channels-based WebSockets into SignalR (#28) 2016-11-15 15:05:45 -08:00
Pranav K 51d4e11e6f Fix more versions 2016-11-11 09:17:22 -08:00
Pranav K 67129b2515 Update dependency versions 2016-11-10 10:27:21 -08:00
David Fowler d00f1f93b2 Added support for net451 and netstandard1.3
- Replaced Task.CompletedTask with TaskCache.CompletedTask
- Updated tests and src
2016-11-07 21:39:19 -08:00
Andrew Stanton-Nurse dfa9c927b7 clean up project.jsons and NuGet.config (#9)
* clean up project.jsons and NuGet.config
* clean up netstandard references
* clean up netstandard tfm
* change WebSockets descriptions
2016-11-07 14:00:41 -08:00
Andrew Stanton-Nurse d299cc9186 apply license headers 2016-11-07 12:00:04 -08:00
David Fowler 7db1eb8f25 Add Async suffix to everything 2016-11-02 22:02:29 -07:00
David Fowler 3032909f3c Added tests 2016-10-04 01:32:30 -07:00