use of com.webpieces.http2parser.api.dto.SettingsFrame in project webpieces by deanhiller.
the class AbstractTest method sendAndAckSettingsFrame.
private void sendAndAckSettingsFrame(long max) throws InterruptedException, ExecutionException {
//server's settings frame is finally coming in as well with maxConcurrent=1
HeaderSettings settings = new HeaderSettings();
settings.setMaxConcurrentStreams(max);
mockChannel.write(HeaderSettings.createSettingsFrame(settings));
//ack client frame
mockChannel.write(new SettingsFrame(true));
SettingsFrame ack = (SettingsFrame) mockChannel.getFrameAndClear();
Assert.assertEquals(true, ack.isAck());
}
use of com.webpieces.http2parser.api.dto.SettingsFrame in project webpieces by deanhiller.
the class Level3IncomingSynchro method applyRemoteSettingsAndAck.
public CompletableFuture<Void> applyRemoteSettingsAndAck(SettingsFrame settings) {
remoteSettings.applyRemoteSettings(settings);
//now that settings is applied, ack the settings
SettingsFrame settingsAck = new SettingsFrame(true);
log.info("sending remote settings ack frame");
return notifyListener.sendControlDataToSocket(settingsAck);
}
use of com.webpieces.http2parser.api.dto.SettingsFrame in project webpieces by deanhiller.
the class TestHttp2Settings method testParseSettings.
@Test
public void testParseSettings() {
DataWrapper data = Util.hexToBytes(basicSettings());
parser.parse(memento, data);
SettingsFrame frame = (SettingsFrame) assertGood();
Assert.assertEquals(0, frame.getStreamId());
Assert.assertFalse(frame.isAck());
Assert.assertEquals(frame.getSettings().size(), 2);
Http2Setting setting = frame.getSettings().get(0);
//first setting must be push from order in the bytes
Assert.assertEquals(SettingsParameter.SETTINGS_ENABLE_PUSH, setting.getKnownName());
Assert.assertEquals(1, setting.getValue());
}
use of com.webpieces.http2parser.api.dto.SettingsFrame in project webpieces by deanhiller.
the class TestHttp2Settings method testMarshalAck.
@Test
public void testMarshalAck() {
SettingsFrame frame = new SettingsFrame();
frame.setAck(true);
byte[] data = parser.marshal(frame).createByteArray();
String hexFrame = Util.toHexString(data);
Assert.assertEquals(ackFrame(), hexFrame);
}
Aggregations