use of com.webpieces.http2parser.api.dto.error.CancelReasonCode in project webpieces by deanhiller.
the class Level7MarshalAndPing method goAway.
public CompletableFuture<Void> goAway(ShutdownConnection shutdown) {
CancelReasonCode reason = shutdown.getReasonCode();
byte[] bytes = shutdown.getReason().getBytes(StandardCharsets.UTF_8);
DataWrapper debug = dataGen.wrapByteArray(bytes);
GoAwayFrame frame = new GoAwayFrame();
frame.setDebugData(debug);
frame.setKnownErrorCode(reason.getErrorCode());
CompletableFuture<Void> future1 = sendControlDataToSocket(frame);
finalLayer.closeSocket(shutdown);
return future1;
}
Aggregations