Commit Graph
9 Commits
Author SHA1 Message Date
Johannes Weiß 94e1af5452 compile warning-free on Swift 4.1 2017-12-18 15:37:57 +00: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 16e0ffd9bf Allow to obtain remote and local address 2017-08-08 15:43:47 +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