Commit Graph

55 Commits

Author SHA1 Message Date
Stephen Halter daa2b7e383 Remove _tasksCompleted from SocketOutput
- _tasksCompleted no longer helps avoid locking longer
2016-01-11 12:40:01 -08:00
Stephen Halter df695accb0 Use TryEnter to acquire SocketOutput._contextLock on the libuv event loop 2016-01-11 12:39:59 -08:00
Stephen Halter e90b61e6c5 Move call to CopyFrom in SocketOutput.WriteAsync inside lock to make writes atomic 2016-01-11 12:39:57 -08:00
clrjunkie 8260e5d93f Remove null-conditional operators and asserts (Blocks must return to pools) 2016-01-09 19:36:26 +02:00
Ben Adams e6bc0bc335 Only scheduleWrites on the threadpool 2016-01-05 11:42:41 +00:00
Ben Adams 480996433e Only queue write when not queued 2016-01-05 11:33:29 +00:00
Cesar Blum Silveira 6fbb9a0cfe Cleanup: private embedded types and readonly where appropriate (#187). 2015-12-30 12:47:13 -08:00
Ben Adams 5665eba646 Pool WriteContexts additionally 2015-12-10 20:31:30 +00:00
Stephen Halter 3e42904096 Pool UvWriteReqs instead of SocketOutput.WriteContexts
- This allows all connections accepted by the same thread to share a pool
2015-12-10 20:31:30 +00:00
Ben Adams 97d3340624 Resuse writes, initalize queues 2015-12-10 20:31:28 +00:00
Stephen Halter dd02a1c442 Fix compiler warnings 2015-12-08 17:31:57 -08:00
Stephen Halter d0dca75241 Remove count parameter from ISocketOutput.ProducingComplete
- This makes the calling code cleaner with a (hopefully) minimal pref impact
2015-12-08 00:09:24 -08:00
Ben Adams b1e8f0cdea Add IThreadPool interface 2015-12-03 10:37:52 +00:00
Ben Adams 5ae9b3c383 Log user code threadpool continuation execptions 2015-12-03 09:56:21 +00:00
Ben Adams 81dba3961d less work in locks 2015-11-21 14:13:23 +00:00
Ben Adams feb40402de merge preamble-output, socket-output 2015-11-21 04:18:06 +00:00
Stephen Halter 0dbf108353 Smarter unpinning of MemoryPoolBlock2 in SocketOutput 2015-11-20 12:59:53 -08:00
Stephen Halter 2572256d3f Use MemoryPool2 for SocketOutput Buffers
Add ProducingStart and ProducingComplete methods to ISocketOutput.
These new methods can help prevent double buffering when encoding.
2015-11-20 04:41:33 -08:00
Stephen Halter b73e42b617 Abort request on any write failure 2015-11-16 16:03:53 -08:00
Stephen Halter fc346f7768 Avoid some closure allocations in SocketOutput 2015-11-12 17:08:44 -08:00
Stephen Halter 59cdd60af6 Don't pre-complete too many writes 2015-11-12 17:08:43 -08:00
Ben Adams d32937eafe Add tests for non-immediate byte counting 2015-11-10 23:17:40 +00:00
Ben Adams 34cec3448d SocketOutput to Tasks 2015-11-10 19:53:43 +00:00
Stephen Halter 2f3a00625a Initial work to support HTTPS using SslStream
- Add extension method "UseKestrelHttps" to IApplicationBuilder
2015-10-05 03:15:18 -07:00
Louis DeJardin 318f3b7145 Changing Trace.Assert to Debug.Assert
* Also Debug.Assert for unreturned memory blocks
2015-09-25 13:01:54 -07:00
Stephen Halter dc902f5fc4 Update SocketOutput to not call QueueUserWorkItem unnecessarily 2015-09-25 12:49:28 -07:00
Louis DeJardin 789d5b3595 Writes which are not immediate always return completed tasks
They must always be followed with Writes which are immediate, and
returning an incomplete task put them in a state where the callback
might not have been initiated.
2015-09-25 12:49:27 -07:00
Louis DeJardin c424b8437c Renaming based on PR feedback 2015-09-25 12:49:24 -07:00
Louis DeJardin 04f6446a50 Updates for PR feedback 2015-09-25 12:49:18 -07:00
Louis DeJardin e5a3bda3a2 Progress on flow control
* Dealing with race conditions
* Reworking iterator methods
* Shutdown and Close need to be passed throught the write-behind mechanism
2015-09-25 12:49:15 -07:00
Louis DeJardin 557f6d6993 Refactoring response control flow
- Bring through both sync and async execution paths
- Remove callback pattern from from and socketoutput write calls
2015-09-25 12:47:51 -07:00
Stephen Halter 0ef096b41c Increment connection id for logging 2015-09-10 11:41:22 -07:00
Ivan Derevyanko a93a66fe7c Replace Trace.WriteLine with ITraceLogger 2015-09-09 00:26:26 +02:00
Ivan Derevyanko 6d47227975 KestrelTrace refactored and added to the ServiceContext. Close aspnet/KestrelHttpServer#141 2015-09-05 18:17:17 +02:00
Louis DeJardin b25d2d9772 Continued updates for #184
* Reordering members
- Fields
- Constructors
- Properties
- EverythingElse
- NestedTypes

* Removing commented code
2015-09-02 20:08:54 -07:00
Stephen Halter 7446fe4cc7 Update SocketOutputTests to account for the "immediate" Write param 2015-08-03 16:20:30 -07:00
Louis DeJardin f6dc72544c Response headers don't need to be queued before subsequent write 2015-08-03 16:20:24 -07:00
Troy Dai 07de3cafd1 Clean build warnings 2015-07-30 12:14:13 -07:00
Stephen Halter 47d7f73bdc Fix SocketOutput so that it can now complete large writes
- Complete in this context means that the callback gets invoked.
- Previously, calls to write would never complete if the buffer contained
  more than 64 KB (_maxBytesPreCompleted).
- This is tested by SocketOutputTests.CanWrite1MB.
2015-07-28 16:57:24 -07:00
Stephen Halter c345849707 Don't use QueueUserWorkItem to trigger write callbacks immediately
- In this case we are off the event loop, so we can invoke the callback directly.
- Increase _maxBytesBufferedBeforeThrottling
2015-07-28 16:57:21 -07:00
Stephen Halter 74fa82bca7 Complete WriteAsync Tasks early when there are less than 64KB buffered 2015-07-28 16:57:19 -07:00
Stephen Halter d723f9da21 Reduce calls to uv_write by calling it with multiple buffers when possible 2015-07-28 16:57:16 -07:00
Louis DeJardin ceeb4edabd Adding UvPipeHandle 2015-07-24 13:50:10 -07:00
Pranav K 853ee00ff5 Merge remote-tracking branch 'origin/release' into dev 2015-07-16 08:43:59 -07:00
Stephen Halter 4b66edc4fe Move non-nested classes and interfaces to their own files 2015-07-06 17:48:58 -07:00
Stephen Halter a992c78548 Dispatch user defined callback so it can't block the event loop 2015-06-15 10:07:58 -07:00
Stephen Halter 7e125faa73 Dispatch user defined callback so it can't block the event loop 2015-06-12 17:02:27 -07:00
N. Taylor Mullen 063fb64c8b Update LICENSE.txt and license header on files. 2015-05-01 13:53:45 -07:00
Louis DeJardin de6c32dc4b Guarding against leaking GCHandles in read/write operations
See #19
2014-07-08 18:11:09 -07:00
Louis DeJardin 8624b82b2b Improving callback exception support
Also renaming KestralTests to KestrelTests
2014-07-07 13:08:25 -07:00