Search in sources :

Example 1 with CancelReasonCode

use of com.webpieces.http2.api.dto.error.CancelReasonCode in project webpieces by deanhiller.

the class Level7MarshalAndPing method goAway.

public XFuture<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());
    XFuture<Void> future1 = sendControlDataToSocket(frame);
    finalLayer.closeSocket(shutdown);
    return future1;
}
Also used : DataWrapper(org.webpieces.data.api.DataWrapper) CancelReasonCode(com.webpieces.http2.api.dto.error.CancelReasonCode) GoAwayFrame(com.webpieces.http2.api.dto.lowlevel.GoAwayFrame)

Aggregations

CancelReasonCode (com.webpieces.http2.api.dto.error.CancelReasonCode)1 GoAwayFrame (com.webpieces.http2.api.dto.lowlevel.GoAwayFrame)1 DataWrapper (org.webpieces.data.api.DataWrapper)1