{
Settings settings = new Settings();
settings.put(new Settings.Setting(Settings.ID.UPLOAD_BANDWIDTH, 1024 * 1024));
settings.put(new Settings.Setting(Settings.ID.DOWNLOAD_BANDWIDTH, 1024 * 1024));
settings.put(new Settings.Setting(Settings.ID.CURRENT_CONGESTION_WINDOW, Settings.Flag.PERSIST, 1024));
final SettingsInfo serverSettingsInfo = new SettingsInfo(settings);
ServerSessionFrameListener serverSessionFrameListener = new ServerSessionFrameListener.Adapter()
{
@Override
public void onConnect(Session session)
{
session.settings(serverSettingsInfo, new FutureCallback());
}
};
final CountDownLatch latch = new CountDownLatch(1);
SessionFrameListener clientSessionFrameListener = new SessionFrameListener.Adapter()
{
@Override
public void onSettings(Session session, SettingsInfo clientSettingsInfo)
{
Assert.assertEquals(serverSettingsInfo.getFlags(), clientSettingsInfo.getFlags());
Assert.assertEquals(serverSettingsInfo.getSettings(), clientSettingsInfo.getSettings());
latch.countDown();
}
};
startClient(startServer(serverSessionFrameListener), clientSessionFrameListener);