Commit Graph
1838 Commits
Author SHA1 Message Date
Johannes Weiss 01c6e175b7 improve FileRegion tests 2018-02-12 11:52:55 +00:00
Norman Maurer 4f75af6582 Allow access to pthread_t via withUnsafe function.
Motivation:

We should better allow access to pthread_t via an withUnsafe function which is more swift-like.

Modifications:

- Add withUnsafePthread and use it
- mark pthread_t as private in Thread.

Result:

More swifty code.
2018-02-12 12:29:07 +01:00
Norman Maurer 0b5d59fd25 Consolidate #if #else blocks and use precondition
Motivation:

We sometimes used fatalError(...) where we really could just use precondation(...). Beside this we can also consolidate the #if #else code for handling Darwin and Linux differently and so make the code easier to maintain.

Modifications:

- Use precondation
- Consoldate #if #else blocks for Thread

Result:

Cleaner and easier to maintain code.
2018-02-12 09:21:14 +01:00
Norman Maurer b09c1598af Fix testcase which was not correctly updated as part of 845d9ee8e95e8ba61e550a26b0a70d59ee98c97d 2018-02-12 08:39:38 +01:00
Norman Maurer a8f0dcf0f5 Use computed property for System.coreCount
Motivation:

We should use a computed property to be more swifty.

Modifications:

Replace function with computed property

Result:

More swifty code.
2018-02-11 13:11:54 +01:00
Johannes Weiß 11a609396d don't blow up when holding onto a ChannelPipeline of a deinitialised Channel 2018-02-09 14:53:09 +00:00
Johannes Weiß ebf351abda implement thread specific values 2018-02-08 17:37:01 +00:00
Cory Benfield 9b0b0f9b51 Add support for SOCK_DGRAM 2018-02-08 14:58:10 +00:00
Cory Benfield 3f357a3c79 Minor cleanups for Swift 4.1 2018-02-08 11:40:45 +00:00
Cory Benfield dfe3fe212a Better readme for release 2018-02-09 12:25:50 +00:00
Johannes Weiss 734904d0f4 clean up the (proto)types for EventLoopFuture
* clean up the (proto)types for EventLoopFuture

* Remove more unnecessary parens
2018-02-09 16:03:28 +00:00
Norman Maurer 17b5fd58e4 Use aliases to reduce duplication and make it easier to maintain.
* Use aliases to reduce duplication and make it easier to maintain.

Motivation:

We used many #if #else blocks which made the code very clumby.

Modifications:

Use aliases and define these in one place.

Result:

Easier to maintain code.

* Comments

* Comments
2018-02-09 16:56:52 +01:00
Norman Maurer e1f015aa07 Remove out of date to do.
Motivation:

TODO is not valid anymore.

Modifications:

Remove it.

Result:

No missleading comment anymore.
2018-02-09 15:03:46 +01:00
Norman Maurer 3bfdd3f55b Adapt git template that is also used by Netty 2018-02-09 12:19:12 +01:00
Norman Maurer 49b0af924d Add docs for Selector
* Add docs for Selector

* comments
2018-02-08 19:36:26 +01:00
Daniel Dunbar 41bf7278f8 [NIO] Fix setOption() to be async.
- This fixes Bootstrap's ChannelOptionStore.applyAll to return a future rather
   than synchronously iterating through all the options.

 - This is particular important because when a server accepts a child, if the
   child channel is on a different event loop then it is possible the
   synchronous calls may deadlock (if the child's eventloop happens to be
   scheduled with a similar accept sequence).

 - I did not tackle also making getOption() async, which means the Channel API
   is asymmetric at the moment. That should probably be addressed, potentialy
   with synchronous wrappers for API compatibility.

 - Fixes: <rdar://problem/37191923> [Omega] Worker tasks fail to close subtasks (many connections in CLOSE_WAIT state)
2018-02-08 09:21:40 -08:00
Norman Maurer 995177fbc6 Support setting Thread affinity and use it with EventLoopGroups 2018-02-06 16:08:57 +01:00
Cory Benfield ce7b0c52ce Add a CompositeError type 2018-02-08 13:12:30 +00:00
Cory Benfield 08817ded87 Remove copy in withMutableSockAddr 2018-02-08 12:52:03 +00:00
Cory Benfield 41f3abe366 BaseSocketChannel should use NIOAny 2018-02-08 11:42:01 +00:00
Cory Benfield d216f6a7e9 Add public constructor for AddressedEnvelope 2018-02-08 11:21:55 +00:00
Johannes Weiß b26bfce61e detach threads so we don't leak them 2018-02-08 10:57:51 +00:00
Cory Benfield 453b87ff5e Fixup thread unsafety 2018-02-08 10:57:46 +00:00
Cory Benfield 3768e2a2b9 Don't allow registration on shutting down loops 2018-02-08 10:25:47 +00:00
Norman Maurer 71f179e63b Change Thread to be internal as we not expose it to the user 2018-02-08 09:26:53 +01:00
Johannes Weiss 8ed8f73d9a remote now unnecessary swiftw script 2018-02-07 17:31:39 +00:00
Johannes Weiss 755ea5aedc non-blocking file IO 2018-02-07 17:25:45 +00:00
Johannes Weiß 676453c8b9 trivial: fix RecvByteBufferAllocator typos 2018-02-06 18:24:48 +00:00
Johannes Weiss e21432e955 don't leak open FileRegions (fds) in HTTP client 2018-02-06 16:35:35 +00:00
Johannes Weiß 9c73c9deb9 fix flaky ChannelTests.testHalfClosure 2018-02-06 15:24:01 +00:00
Johannes Weiß 32bb597c24 remove Int extension we do not need 2018-02-06 12:30:27 +00:00
Norman Maurer e1bf447a9a Replace usage of Foundation.Thread with our own Thread that just used…
* Replace usage of Foundation.Thread with our own Thread that just used pthread

* Address comments

* some more docs / comments

* Address comments of cory
2018-02-06 11:45:57 +01:00
Daniel Dunbar 74a10d8137 [SocketAddress] Add .port accessor.
- This is for convenience in clients which want to get the assigned port, when
   OS-assigned ports are used.
2018-02-05 12:42:57 -08:00
Johannes Weiss 66a26cee57 fix http parser updater: didn't process header file 2018-02-02 19:40:42 +00:00
Cory Benfield 2630d583cd Happy Eyeballs! 2018-02-02 17:26:51 +00:00
Cory Benfield 1ae2c97903 Make SocketAddress equatable 2018-02-02 10:28:11 +00:00
Cory Benfield b3ed4eee1b Preparatory refactor of PWM for datagrams 2018-01-31 16:21:13 +00:00
Tom Doron a4b9862711 fix doc generation to include deleted files
motivation: in git 2.0 deleted files are ignored unless --all is specified

```
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
whose behaviour will change in Git 2.0 with respect to paths you removed.
Paths like 'docs/current/NIOOpenSSL/Classes.html' that are
removed from your working tree are ignored with this version of Git.
```

changes: use git add -all docs to includes removeals
2018-01-31 11:12:59 -08:00
Johannes Weiss 07ff34087a make IOResult equatable 2018-01-31 18:02:32 +00:00
Cory Benfield 5ce3ac2142 Add socket address helpers 2018-01-31 15:43:45 +00:00
Johannes Weiss ce1d4bb7d8 fix ByteBuffer docs of withUnsafeWritableBytes 2018-01-31 14:15:22 +00:00
Johannes Weiß 05047ec852 switch to Jazzy's fullwidth theme 2018-01-31 10:53:52 +00:00
Johannes Weiß 8c7105f0a3 remove lazy create todo 2018-01-31 10:58:09 +00:00
Max (Swift) Moiseev 973a96004d Get rid of free functions
* Lift the EventLoopFuture.== into the type extension and add the Equatable conformance

* Get rid of the only public free function systemCoreCount
2018-01-30 10:41:44 -08:00
Cory Benfield 69a9b378a4 Add AddressedEnvelope type 2018-01-30 16:09:10 +00:00
Johannes Weiss 945f352e2d advertise documentation 2018-01-30 12:56:23 +00:00
Johannes Weiß b2c63337d9 prefix http parser to prevent symbol clashes 2018-01-30 11:14:03 +00:00
Johannes Weiß 606df54ee1 don't try generating NIOOpenSSL docs in main repo 2018-01-30 12:15:07 +00:00
Johannes Weiss eab7d314f3 make Channel non optional in ChannelHandlerContext 2018-01-30 12:03:51 +00:00
Norman Maurer 786c2ed32e Fix promise passing 2018-01-25 15:47:42 +01:00