mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
ChannelHandler: provide static (un)wrap(In|Out)bound(In|Out) (#2791)
This commit is contained in:
1 parent
223b0e8eac
commit
7948ed2104
72 files changed
+369
-343
No files matched your search
@@ -42,16 +42,16 @@ private final class HTTPEchoHandler: ChannelInboundHandler {
|
||||
uri: "/dynamic/echo",
|
||||
headers: headers)
|
||||
|
||||
context.write(self.wrapOutboundOut(.head(requestHead)), promise: nil)
|
||||
context.write(Self.wrapOutboundOut(.head(requestHead)), promise: nil)
|
||||
|
||||
context.write(self.wrapOutboundOut(.body(.byteBuffer(buffer))), promise: nil)
|
||||
context.write(Self.wrapOutboundOut(.body(.byteBuffer(buffer))), promise: nil)
|
||||
|
||||
context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||
context.writeAndFlush(Self.wrapOutboundOut(.end(nil)), promise: nil)
|
||||
}
|
||||
|
||||
public func channelRead(context: ChannelHandlerContext, data: NIOAny) {
|
||||
|
||||
let clientResponse = self.unwrapInboundIn(data)
|
||||
let clientResponse = Self.unwrapInboundIn(data)
|
||||
|
||||
switch clientResponse {
|
||||
case .head(let responseHead):
|
||||
|
||||
Reference in new issue
Block a user