Commit Graph

64 Commits

Author SHA1 Message Date
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
David Fowler f1a3775247
Copy HttpContext properties for long polling transport (#1684)
- The long polling transport simulates a persistent connection
over multiple http requests. In order to expose common http request
properties, we need to copy them to a fake http context on the first poll
and set that as the HttpContext exposed via the IHttpContextFeature.
2018-03-22 15:24:35 -07:00
James Newton-King 3f84eee116
Detect availability of web sockets on client and server (#1682) 2018-03-22 12:35:31 +13:00
BrennanConroy 0e38ee3e63
Create connectionIds using RNGCrypto (#1606) 2018-03-16 16:16:34 -07:00
David Fowler d27844dfef
ConnectionMetadata is now ConnectionItems (#1604)
* ConnectionMetadata is now ConnectionItems
2018-03-14 20:57:40 -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
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
Pavel Krymets 4a4efe0f39
Update to new corefx (#1561) 2018-03-08 14:23:20 -08:00
Pavel Krymets 8908eec6e7
Pipelines in corefx (#1501) 2018-02-28 12:42:01 -08:00
Mikael Mengistu 0e4731e480
Expose Transport and Application Max Buffer Sizes (#1473) 2018-02-25 08:47:14 +00:00
David Fowler 94155b0e89
Use protocol.abstractions primitives instead of socket abstractions (#1432) 2018-02-10 18:10:09 -08:00
David Fowler 3e568588d2
Revert "Use protocol.abstractions primitives instead of socket abstractions (#1429)" (#1431)
This reverts commit e3f197cef0.
2018-02-10 11:30:41 -08:00
David Fowler e3f197cef0
Use protocol.abstractions primitives instead of socket abstractions (#1429) 2018-02-10 10:45:07 -08:00
David Fowler 28439d1441
Initial changes to move to pipelines (#1424)
- Change the Sockets abstraction from Channel<byte[]> to pipelines.

#615
2018-02-09 17:45:21 -08:00
BrennanConroy 5ccc9e3a0e
Remove some test flakiness and add logging (#1402) 2018-02-02 15:04:48 -08:00
Andrew Stanton-Nurse c1d2024864
Implement #1156 by having the server send Ping messages (#1161) 2017-12-04 14:43:27 -08:00
BrennanConroy 93cbf4dbef
Change negotiate to POST (#1122) 2017-11-17 15:31:47 -08:00
BrennanConroy 792745ad98 React to CoreFxLab packages (#998) 2017-11-13 15:05:35 -08:00
David Fowler 65cd41dbf5 Block POST requests for websocket connections (#934) 2017-09-23 17:49:19 -07:00
BrennanConroy b8a936f2c1 Use IApplicationLifetime instead of IHostedService (#757) 2017-08-24 00:10:18 -07:00
Pawel Kadluczka ae815475b8 Support for binary protocols on the server side 2017-07-20 17:46:45 -07:00
Hao Kung 2d16cd2273 React to default auth change 2017-07-07 19:20:20 -07:00
Hao Kung d125a14a39 React to HttpAbstractions 2017-06-29 16:30:38 -07:00
BrennanConroy ef273b4796 Add authorization per hub method (#577) 2017-06-23 10:22:05 -07:00
David Fowler a84ba8820f Use Channel<byte[]> as the abstraction (#579)
* Use Channel<byte[]> as the abstraction
2017-06-23 09:52:35 -07:00
David Fowler 523517f60c Add support for timing out poll requests (#538)
* Add support for timing out poll requests
- Default poll request is 110 seconds (like in previous versions of SignalR)
- Use 200 with a 0 content length for timeouts.
- Added support for not timing out while debugging
2017-06-07 20:55:00 -10:00
BrennanConroy d1df3671d8 Add Auth Test that was accidentally deleted (#541) 2017-06-07 14:29:59 -07:00
Pawel Kadluczka a14a0ab039 Adding structured negotiate 2017-06-06 15:53:21 -07:00
BrennanConroy 4c4be7ed6f Add support for Hub Authorize Attribute (#532) 2017-06-06 15:46:08 -07:00
David Fowler 38efde7b50 Merge transport and hub protocols (#517)
* Merge transport and hub protocols
- This change merges the transport and hub protocols into a single protocol. The
idea being that sockets in a purely streaming layer that sends frames from the underlying
transport. This makes things like TCP possible and doesn't impose a framing layer at the lowest
level. This will make it possible to build servers like kestrel on top of the TCP layer.
- The Message was removed from the lowest layer of the stack and pushed into the hubs layer. Hub invocations
are framed with what was before the transport protocol. Connections also need to state upfront if they support
binary or not. This will determine how data will be serialized to the specific connection.
- Changed the SSE parser and writer to be strictly SSE without any of the transport protocol specific
information.
- To ensure we aren't using types in the wrong layers
- Moved protocol logic into SignalR
- Socket.Abstractions is now the root of the universe, Sockets.Common will likely be removed
or turned into Sockets.Common.Http.
- Move SSE parser to Sockets.Client and SSE writer into Sockets.Http
- Moved tests into the appropriate test projects
- Updated the spec
2017-06-05 09:45:40 -10:00
David Fowler 831fa72893 Remove the RequestId from DefaultConnectionContext (#516)
* Remove the RequestId from DefaultConnectionContext
- Added a GetHttpContext() extension method on ConnectionContext
- Also fixed an issue not setting LastSeenUtc
2017-06-03 22:05:44 -10:00
David Fowler b77f50a99a Merge DefaultConnectionContext with ConnectionState (#514)
* Merge DefaultConnectionContext with ConnectionState
- Removed ConnectionState as a result
2017-06-03 12:14:01 -10:00
David Fowler 42e2715a95 Removed EndOfMessage from Message (#513)
* Removed EndOfMessage from Message
- The webSockets transport no longer supports partial payloads so
this feature is now gone.
2017-06-03 08:32:28 -10:00
David Fowler 72423ee203 Removed custom websocket implementation (#507)
- Use the default websocket middleware
- Rewrote TestWebSocketConnectionFeature to use Channels instead of pipes
2017-06-03 06:53:39 -10:00
Pawel Kadluczka e31fc1e57d Closing transports with error if hubs cannot be created
- Preventing from closing long polling transport with 204 in case of
error
- Reporting an error to the client if WebSocket was not closed normally

Note in case of ServerSentEvents it is not possible on the client to
tell the difference between when the server closed event stream due to
an exception or because the client left OnConnectedAsync. In both cases
the client sees only that the stream was closed.

Part of: #163
2017-05-31 16:29:28 -07:00
Hao Kung 42739b064f React to Auth + switch to PolicyEvaluator 2017-05-25 18:22:51 -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
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
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 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 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
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 0133153bc9 use new protocol for '/send' (#297) 2017-03-15 18:03:23 -07:00
BrennanConroy 485f9595e2 EndPoint options and injection 2017-03-01 14:38:50 -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