diff --git a/Sources/NIOPosix/BaseSocketChannel.swift b/Sources/NIOPosix/BaseSocketChannel.swift index 50668f35a5..2a1951531f 100644 --- a/Sources/NIOPosix/BaseSocketChannel.swift +++ b/Sources/NIOPosix/BaseSocketChannel.swift @@ -223,7 +223,7 @@ private struct SocketChannelLifecycleManager { /// For this reason, `BaseSocketChannel` exists to provide a common core implementation of /// the `SelectableChannel` protocol. It uses a number of private functions to provide hooks /// for subclasses to implement the specific logic to handle their writes and reads. -class BaseSocketChannel: SelectableChannel, ChannelCore { +class BaseSocketChannel: SelectableChannel, ChannelCore, @unchecked Sendable { typealias SelectableType = SocketType.SelectableType struct AddressCache { @@ -1419,7 +1419,7 @@ extension BaseSocketChannel { } /// Execute the given function and synchronously complete the given `EventLoopPromise` (if not `nil`). -func executeAndComplete(_ promise: EventLoopPromise?, _ body: () throws -> Value) { +func executeAndComplete(_ promise: EventLoopPromise?, _ body: () throws -> Value) { do { let result = try body() promise?.succeed(result) diff --git a/Sources/NIOPosix/BaseStreamSocketChannel.swift b/Sources/NIOPosix/BaseStreamSocketChannel.swift index 6f04ecec6d..7878415d3f 100644 --- a/Sources/NIOPosix/BaseStreamSocketChannel.swift +++ b/Sources/NIOPosix/BaseStreamSocketChannel.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import NIOCore -class BaseStreamSocketChannel: BaseSocketChannel { +class BaseStreamSocketChannel: BaseSocketChannel, @unchecked Sendable { internal var connectTimeoutScheduled: Optional> private var allowRemoteHalfClosure: Bool = false private var inputShutdown: Bool = false diff --git a/Sources/NIOPosix/PipeChannel.swift b/Sources/NIOPosix/PipeChannel.swift index e105a724f1..27130a292b 100644 --- a/Sources/NIOPosix/PipeChannel.swift +++ b/Sources/NIOPosix/PipeChannel.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import NIOCore -final class PipeChannel: BaseStreamSocketChannel { +final class PipeChannel: BaseStreamSocketChannel, @unchecked Sendable { private let pipePair: PipePair internal enum Direction { diff --git a/Sources/NIOPosix/SocketChannel.swift b/Sources/NIOPosix/SocketChannel.swift index 6dd2271311..fd51c008ce 100644 --- a/Sources/NIOPosix/SocketChannel.swift +++ b/Sources/NIOPosix/SocketChannel.swift @@ -50,7 +50,7 @@ extension ByteBuffer { /// A `Channel` for a client socket. /// /// - Note: All operations on `SocketChannel` are thread-safe. -final class SocketChannel: BaseStreamSocketChannel { +final class SocketChannel: BaseStreamSocketChannel, @unchecked Sendable { private var connectTimeout: TimeAmount? = nil init(eventLoop: SelectableEventLoop, protocolFamily: NIOBSDSocket.ProtocolFamily, enableMPTCP: Bool = false) throws @@ -192,7 +192,7 @@ final class SocketChannel: BaseStreamSocketChannel { /// A `Channel` for a server socket. /// /// - Note: All operations on `ServerSocketChannel` are thread-safe. -final class ServerSocketChannel: BaseSocketChannel { +final class ServerSocketChannel: BaseSocketChannel, @unchecked Sendable { private var backlog: Int32 = 128 private let group: EventLoopGroup @@ -451,7 +451,7 @@ final class ServerSocketChannel: BaseSocketChannel { /// A channel used with datagram sockets. /// /// Currently, it does not support connected mode which is well worth adding. -final class DatagramChannel: BaseSocketChannel { +final class DatagramChannel: BaseSocketChannel, @unchecked Sendable { private var reportExplicitCongestionNotifications = false private var receivePacketInfo = false