Commit Graph
12 Commits
Author SHA1 Message Date
Johannes Weiß 94e1af5452 compile warning-free on Swift 4.1 2017-12-18 15:37:57 +00:00
Johannes Weiss 64a1c2feb8 Channel writes: unit tests & lots of fixes 2017-12-11 12:20:46 +00:00
Johannes Weiss 215620d7a6 syscall wrapper: don't do an allocation for every failed syscall 2017-12-07 15:37:12 +00:00
Norman Maurer 5475ba069a Add docs for IO and Selectable and also rename error parameter name to errorCode to ensure we not capture errno by mistake.
Motivation:

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modifications:

Describe the modifications you've done.

Result:

After your change, what will change.
2017-12-05 15:44:50 +01:00
Norman Maurer 68a475b37a Rename IOError.errno to IOError.errnoCode as errno is always in scope 2017-11-17 15:45:12 +01:00
Norman Maurer ba35fcb5a5 Move all syscalls that also need to handle errno in an extra file and ensure we not get any problems with invalid errno handling
* Move all syscalls that also need to handle errno in an extra file and ensure we not get any problems with invalid errno handling

Motivation:

Because it is possible ARC cause an syscall and so set the errno value we need to ensure no ARC can ever happen before we were able to read the errno value that was caused by an syscall we made.

Modifications:

Move all syscalls to an extra file (System.swift) and ensure all exposed methods are marked with `@inline(never)` and not capture any classes. This ensures no ARC can ever happen.

Result:

Be able to safely read errno if needed.

* Comments
2017-11-16 16:41:19 +01:00
Johannes Weiss 1adb581f59 remove more Foundation imports 2017-10-10 16:25:43 +01:00
Cory Benfield 007feec636 Add Unix domain socket support part 2: Electric Boogaloo
* support UNIX Domain Sockets

* Add test for connect: with UDS path

* Add UDS-special connect method
2017-09-21 15:26:37 +01:00
Norman Maurer 1619c3d7c8 Add support for sendFile by allow to write a FileRegion. 2017-08-11 20:32:04 +02:00
Johannes Weiß 55bed8359b IPv6 support 2017-07-25 16:55:27 +01:00
Norman Maurer 9f2aa75f9e Correctly extract address from enum when bind / connect.
Before this change binding a socket failed via:

NIO.IOError(errno: 22, reason: Optional("bind failed: errno(22) Invalid argument")):

This regression was introduced by 9485e583a7f8d6a0e1e36cfff05a8719f7c8c48e.
2017-07-23 14:44:08 +02: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