Commit Graph
163 Commits
Author SHA1 Message Date
Norman Maurer e8c3a3083a Add more asserts to ensure methods are called from within the EventLoop 2017-12-27 13:59:08 +01:00
Norman Maurer 8b9a31536e Allow to specify a connect timeout 2017-12-20 15:26:39 +01:00
Norman Maurer 9015d08310 Use switch statements to handle ChannelOptions 2017-12-20 20:54:39 +01:00
Johannes Weiß eaf658691c some grammar fixes 2017-12-19 15:23:26 +00:00
Johannes Weiss fa35c603a0 on Darwin, sendfile might write fully and return EWOULDBLOCK 2017-12-15 16:58:12 +00:00
Johannes Weiss 8a1297eff1 Channel docs 2017-12-13 16:07:14 +00:00
Johannes Weiss e4ef4c19f7 fix write spinning (should be max writeSpinCount writes) 2017-12-12 14:14:10 +00:00
Johannes Weiss 59566c6365 Channel writes: Tighter asserts & now 100% test coverage 2017-12-12 12:57:45 +00:00
Johannes Weiss b203c602a9 Channel writes: more bugs found & fixed 2017-12-12 08:05:57 +00:00
Johannes Weiss 64a1c2feb8 Channel writes: unit tests & lots of fixes 2017-12-11 12:20:46 +00:00
Johannes Weiss b579f80efd in failAll we double accounted for outstanding ByteBuffers :( 2017-12-08 09:40:31 +00:00
Johannes Weiß e1b30f0a3d fix Channel writes 2017-12-05 17:08:42 +00:00
Johannes Weiss ff991da658 make the CircularBuffer implementation more straightforward & docs 2017-12-04 16:59:16 +00:00
Norman Maurer 1a9cd14118 More agressively try to increase the number of bytes we read from the Channel per read.
Motiviation:

We used to only allocate one buffer per read loop (by default we use multiple reads per loop) and record for the next loop iteration if we need to allocate a bigger buffer or not. This can lead to very slowely ramping up of number of bytes we read. We should better detect if we should allocate a new buffer because we used all the writable bytes to allow faster ramping up of numbre of bytes to read .

Modification:

- Change RecvByteBufferAllocator.record to return a Bool that wil lsignal if we used all the writable bytes of the last allocation and so may want to try to allocate a bigger buffer again
- Adjust tests.

Result:

Faster adjustment of the ByteBuffer capacity when reading data.
2017-12-04 15:43:13 +01:00
Johannes Weiß 06f9b1d63b merge ConcurrencyHelpers 2017-11-21 18:32:33 +00:00
Johannes Weiß 33fe401322 rename Future/Promise to EventLoopFuture/EventLoopPromise 2017-11-21 17:41:36 +00:00
Max Moiseev 01b28a3f6d Simplify logic in guards (replace some with ifs instead) 2017-11-16 17:29:35 -08:00
Cory Benfield 10f93fdca0 Minor fixups in Channel sending logic 2017-11-13 15:34:01 +00:00
Cory Benfield 8d2f13be68 Add parent property 2017-11-13 10:11:52 +00:00
Cory Benfield be81dbacff Forbid oversized writev calls 2017-11-10 16:08:49 +00:00
Cory Benfield 13d80285c8 Don't write too much to writev 2017-11-10 15:45:41 +00:00
Johannes Weiß 6173bee782 Split IOData into NIOAny & IOData (ByteBuffer | FileRegion) 2017-10-25 19:31:27 +01:00
Cory Benfield 25d57e8fab Add Channel.isActive 2017-10-19 16:44:42 -07:00
Johannes Weiss 2889c7e3de fix buffer confusion on incomplete writes 2017-10-17 16:51:15 +01:00
Johannes Weiss 1adb581f59 remove more Foundation imports 2017-10-10 16:25:43 +01:00
Cory Benfield 55ae8a8606 Make MarkedCircularBuffer public 2017-10-02 11:36:29 +01:00
Cory Benfield e2722732b7 Allow write during channelActive.
* Test that we can write during channelActive

* Flush after connect complete
2017-09-27 16:46:15 +01:00
Cory Benfield 35dd5fce48 Flush immediately without pending writes.
* Add failing test for flush on empty

* Succeed flushes immediately when possible
2017-09-27 16:24:43 +01:00
Johannes Weiss a73d46f218 HTTP/1.1 Chunked Encoding
* HTTP/1.1 Chunked Encoding

* fix MarkedCircularBuffer: if not marked do not try to move mark when removing first

* fix HTTPRequestDecoder: dispatch callouts after parsing is complete

* fix HTTPTest: feed pipeline the inbound data correctly
2017-09-25 15:33:02 +01:00
Johannes Weiss cee2a35a41 give user useful message if IOData unwrap fails 2017-09-25 13:00:09 +01:00
Johannes Weiss da905d17f8 channelInactive should fire before channelUnregistered 2017-09-18 14:42:35 +01:00
Johannes Weiß 3ea35268d4 fully close Channel before firing channelInactive/Unregistered 2017-09-15 18:29:20 +01:00
Johannes Weiss 69765f58d6 refactor already closed errors 2017-09-15 18:18:22 +01:00
Cory Benfield 4c37eee3f8 Pipelines that write before they read must remain readable.
* Test that we can write and then read

* Correctly unregister writability
2017-09-15 16:41:52 +01:00
Cory Benfield 5d7da679af Fire channelActive on successful connect 2017-09-15 14:24:48 +01:00
Norman Maurer 4f91fe3f65 Fix possible infinite recursive loop when deregistering from the Selector throws an error while in close0 method 2017-08-16 19:36:50 +02:00
Norman Maurer 1619c3d7c8 Add support for sendFile by allow to write a FileRegion. 2017-08-11 20:32:04 +02:00
Johannes Weiß f42420f0d2 circular buffer for pending writes 2017-08-11 17:05:58 +01:00
Norman Maurer a708c33008 Fix Channel.connect(...) and add unit test that shows using swift-nio to build clients / servers work 2017-08-08 13:52:40 +02:00
Norman Maurer f71d82f3f4 Ensure flush and read promise are failed if Channel is already closed 2017-07-31 17:13:41 +02:00
Johannes Weiß 55bed8359b IPv6 support 2017-07-25 16:55:27 +01:00
Norman Maurer ff1ab56ab2 Call pendingWrites.failAll(...) in a non delayed fashion to ensure closing of the Channel is reflected directly 2017-07-07 10:26:11 +02:00
Norman Maurer 2d235020d0 Add EmbeddedChannel.writeInbound|Outbound methods which make it easier to use EmbbeddedChannel for testing etc 2017-07-06 11:08:48 +02:00
Norman Maurer 354fd7f623 Use whenComplete(...) when register child channel 2017-07-04 21:04:51 +02:00
Johannes Weiß c09178ceb2 baby steps towards a type-safe Channel pipeline 2017-06-30 13:04:19 +01:00
Norman Maurer fd936557c4 Move Socket/* into NIO/ for max performance
Before:

`Bandwidth per channel: 18870.319⇅ Mbps (2358789.8 kBps)`

After:

`Bandwidth per channel: 21330.617⇅ Mbps (2666327.1 kBps)`
2017-07-03 14:52:09 +02:00
Norman Maurer 6e55eb0ade Rename InterestedEvent to IOEvent and reuse it in SelectorEvent to make things more consistent 2017-07-03 13:24:02 +02:00
Norman Maurer 55fad73cd6 Introduce triggerUserOutboundEvent as this is a feature that we noticed is missing from netty 2017-07-03 09:56:16 +02:00
Norman Maurer 851296002e Simplify code and some cleanup 2017-07-02 09:12:16 +02:00
Norman Maurer 21088d0680 Set maxMessagesPerRead to 4 as default value 2017-07-01 14:55:23 +02:00