Skip to content

Commit

Permalink
more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
glbrntt committed Jan 14, 2025
1 parent a08d4ed commit e40bd0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/NIOWritePCAPDemo/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ defer {
let allDonePromise = group.next().makePromise(of: ByteBuffer.self)
let connection = try ClientBootstrap(group: group.next())
.channelInitializer { channel in
channel.pipeline.addHandler(NIOWritePCAPHandler(mode: .client, fileSink: fileSink.write)).flatMap {
channel.pipeline.addHTTPClientHandlers()
}.flatMap {
channel.pipeline.addHandler(SendSimpleRequestHandler(allDonePromise: allDonePromise))
channel.eventLoop.makeCompletedFuture {
let sync = channel.pipeline.syncOperations
try sync.addHandler(NIOWritePCAPHandler(mode: .client, fileSink: fileSink.write))
try sync.addHTTPClientHandlers()
try sync.addHandlers(SendSimpleRequestHandler(allDonePromise: allDonePromise))
}
}
.connect(host: "httpbin.org", port: 80)
Expand Down

0 comments on commit e40bd0e

Please sign in to comment.