Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/APNSExample/Program.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct Main {
),
environment: .development
),
eventLoopGroupProvider: .createNew,
eventLoopGroupProvider: .shared(MultiThreadedEventLoopGroup.singleton),
responseDecoder: JSONDecoder(),
requestEncoder: JSONEncoder()
)
Expand Down
8 changes: 6 additions & 2 deletions Sources/APNSTestServer/APNSTestServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ public final class APNSTestServer: @unchecked Sendable {
.serverChannelOption(ChannelOptions.backlog, value: 256)
.serverChannelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1)
.childChannelInitializer { channel in
channel.pipeline.configureHTTPServerPipeline().flatMap {
channel.pipeline.addHandler(APNSRequestHandler(server: self))
do {
try channel.pipeline.syncOperations.configureHTTPServerPipeline()
try channel.pipeline.syncOperations.addHandler(APNSRequestHandler(server: self))
return channel.eventLoop.makeSucceededVoidFuture()
} catch {
return channel.eventLoop.makeFailedFuture(error)
}
}

Expand Down
3 changes: 2 additions & 1 deletion Tests/APNSTests/APNSClientIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import APNS
import APNSTestServer
import Crypto
import NIOPosix
import XCTest

final class APNSClientIntegrationTests: XCTestCase {
Expand All @@ -40,7 +41,7 @@ final class APNSClientIntegrationTests: XCTestCase {
),
environment: .custom(url: "http://127.0.0.1", port: serverPort)
),
eventLoopGroupProvider: .createNew,
eventLoopGroupProvider: .shared(MultiThreadedEventLoopGroup.singleton),
responseDecoder: JSONDecoder(),
requestEncoder: JSONEncoder()
)
Expand Down
3 changes: 2 additions & 1 deletion Tests/APNSTests/Broadcast/APNSBroadcastClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import APNS
import APNSTestServer
import Crypto
import NIOPosix
import XCTest

final class APNSBroadcastClientTests: XCTestCase {
Expand All @@ -39,7 +40,7 @@ final class APNSBroadcastClientTests: XCTestCase {
),
environment: .custom(url: "http://127.0.0.1", port: serverPort),
bundleID: "com.example.testapp",
eventLoopGroupProvider: .createNew,
eventLoopGroupProvider: .shared(MultiThreadedEventLoopGroup.singleton),
responseDecoder: JSONDecoder(),
requestEncoder: JSONEncoder()
)
Expand Down