Commit 17a28d6
committed
Add experimental WinIO support
Another attempt at #364, #509, #602 with the following design choices:
1. On Windows systems, `Socket` becomes an `Either` over the existing
"Posix" socket implemntation and a Windows equivalent using its
`SOCKET` type.
2. On Posix systems, or without enabling the WinIO manager with
`--io-manager=native`, the current behavior is unchanged.
3. *With* the WinIO manager, a greenfield implementation around the
relevant syscalls is used, using IO Completion Ports
(AKA "Overlapped IO") through GHC's `withOverlapped`
For the places we need to mux between the two
(`Network.Socket.Syscall`, `Network.Socket.Buffer`, etc.)
the existing implementation is moved into a `Posix.hsc`
and the WinIO one is defined in `WinIO.hsc`.
There's certainly some cleanup and style improvements that could be
done, but it passes all existing tests, and hopefully provides a clean
separation between the existing code (which can stay unchanged) and
direct use of Windows syscalls through `withOverlapped`.1 parent 7a177c1 commit 17a28d6
File tree
18 files changed
+1550
-279
lines changed- Network/Socket
- Buffer
- Options
- Syscall
- Types
- Win32
- cbits
18 files changed
+1550
-279
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
Lines changed: 39 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
48 | 78 | | |
49 | 79 | | |
50 | 80 | | |
| |||
122 | 152 | | |
123 | 153 | | |
124 | 154 | | |
125 | | - | |
| 155 | + | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
290 | 320 | | |
291 | 321 | | |
292 | 322 | | |
293 | | - | |
| 323 | + | |
294 | 324 | | |
295 | | - | |
| 325 | + | |
296 | 326 | | |
297 | | - | |
| 327 | + | |
298 | 328 | | |
299 | 329 | | |
300 | 330 | | |
| |||
321 | 351 | | |
322 | 352 | | |
323 | 353 | | |
324 | | - | |
| |||
0 commit comments