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
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
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
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
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 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
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ß
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 Weiß
b2c63337d9
prefix http parser to prevent symbol clashes
2018-01-30 11:14:03 +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
Norman Maurer
3d8965b114
Share promise notify code via an internal function
2018-01-18 18:52:40 +00:00
Johannes Weiss
af4dabb0fa
rename the Future's functor map function to map
2018-01-30 08:25:20 +00:00
Norman Maurer
46ac01f517
Use AdaptiveRecvBufferAllocator in the example as this is what users usually should do
2018-01-29 15:01:30 +01:00
Johannes Weiss
b3799b9403
take OpenSSL support out of tree
2018-01-26 09:50:38 +00:00
Johannes Weiss
0853dc3911
stop atomics from allocating on every operation
2018-01-26 09:11:59 +00:00
Cory Benfield
1fffa95ad1
Make ChannelCore writes use NIOAny
2018-01-25 12:12:02 +00:00
Johannes Weiss
4a2425f5b7
promise leak debugging
2018-01-24 08:21:35 +00:00
Cory Benfield
d0a7b539a8
Remove unnecessary parent method
2018-01-23 16:48:37 +00:00
Cory Benfield
fb5ccef63b
Further channel refactoring.
...
* Move current override methods to top
* Move writing implementation to SocketChannel
* More documentation
2018-01-23 15:08:50 +00:00
Cory Benfield
66462dd2ce
Split Channel.swift up a bit
2018-01-23 09:31:08 +00:00
Johannes Weiss
88d57f16d2
fix static assert compilation warning
2018-01-22 16:26:17 +00:00