first cut at B2MD v2 (#675)

Motivation:

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modifications:

Describe the modifications you've done.

Result:

After your change, what will change.
This commit is contained in:
Johannes Weiss authored and GitHub committed 2018-12-10 16:23:12 +00:00
1 parent 9b78557aff
commit cbc214938a
12 files changed
+612 -187

No files matched your search

@@ -224,7 +224,6 @@ public final class WebSocketFrameDecoder: ByteToMessageDecoder {
public typealias InboundIn = ByteBuffer
public typealias InboundOut = WebSocketFrame
public typealias OutboundOut = WebSocketFrame
public var cumulationBuffer: ByteBuffer? = nil
/// The maximum frame size the decoder is willing to tolerate from the remote peer.
/* private but tests */ let maxFrameSize: Int
@@ -310,7 +309,7 @@ public final class WebSocketFrameDecoder: ByteToMessageDecoder {
let frame = WebSocketFrame(fin: true,
opcode: .connectionClose,
data: data)
ctx.writeAndFlush(self.wrapOutboundOut(frame)).whenComplete {
ctx.writeAndFlush(self.wrapInboundOut(frame)).whenComplete {
ctx.close(promise: nil)
}
}