Commit Graph

9 Commits

Author SHA1 Message Date
David Nadoba 6720612111
Drop Swift 5.5 (#2406)
* Drop Swift 5.5

* Use `swift-atomics` 1.1.0 with `Sendable` adoption
2023-04-17 08:40:35 +01:00
David Nadoba 1100054107
Functions passed to non-`Sendable` `ChannelHandler`s do *not* need to be `Sendable` (#2249) 2022-08-26 17:59:34 +02:00
David Nadoba f1d62128c4
Adopt `Sendable` for Closures in `NIOWebSocket` (#2218)
Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-07-05 04:07:44 -07:00
David Nadoba fbe7ef484a
Adopt `Sendable` for Types in `NIOWebSocket` (#2217) 2022-07-05 11:50:55 +01:00
Johannes Weiss b2629903ca
ByteBuffer: provide multi read/write int methods (#1987)
Motivation:

Many network protocols (especially for example NFS) have quite a number
of integer values next to each other. In NIO, you'd normally parse/write
them with multiple read/writeInteger calls.

Unfortunately, that's a bit wasteful because we're checking the bounds
as well as the CoW state every time.

Modifications:

- Provide read/writeMultipleIntegers for up to 15 FixedWidthIntegers.
- Benchmarks

Result:

Faster code. For 10 UInt32s, this is a 5x performance win on my machine,
see benchmarks.
2021-11-22 14:58:52 +00:00
Cory Benfield 64285cbff2
Clean up dependencies and imports. (#1935)
Motivation:

As we've largely completed our move to split out our core abstractions,
we now have an opportunity to clean up our dependencies and imports. We
should arrange for everything to only import NIO if it actually needs
it, and to correctly express dependencies on NIOCore and NIOEmbedded
where they exist.

We aren't yet splitting out tests that only test functionality in
NIOCore, that will follow in a separate patch.

Modifications:

- Fixed up imports
- Made sure our protocols only require NIOCore.

Result:

Better expression of dependencies.

Co-authored-by: George Barnett <gbarnett@apple.com>
2021-08-12 13:49:46 +01:00
David Nadoba 465f87dd7c
Random WebSocket Request Key (#1855)
* add randomRequestKey method

* fix some typos

* fix compilation on 5.0

* run generate_linux_tests.rb

* add test with default random number generator

* @inlineable

* base64Encoding @inlineable
2021-05-24 16:02:16 +01:00
Liam Flynn 8ccae09377 Correct NIOHTTPWebClientSocketUpgrader to NIOHTTPWebSocketClientUpgrader (#1336)
Motivation:

The class name was a typo.
It is a client upgrader that upgrades WebSocket connections, so the updated name suits better.

Modifications:

Change class name of ‘NIOHTTPWebClientSocketUpgrader’ to ‘NIOHTTPWebSocketClientUpgrader’.
Update the WebSocket client example that uses this class.
Add a typealias to allow the old class name to be used.

Result:

Improved naming.
2020-01-15 09:24:50 +00:00
Liam Flynn 64c673b6e8 Add a WebSocket client upgrader. (#1038)
Motivation:

There is a client protocol upgrader but, unlike the server protocol upgrader, it does not have a WebSocket protocol as part of the project.

Modifications:

Made the magic WebSocket GUID public to the WebSockets project.
Added a NIOWebSocketClientUpgrader.
Added tests for the upgrader.
Updated the Linux test script files.

Result:

The project now has a WebSocket client upgrader to match the WebSocket server upgrader.
2019-07-08 03:55:02 -04:00