use of io.scalecube.transport.TransportConfig in project scalecube by scalecube.
the class GossipProtocolTest method initTransports.
private List<Transport> initTransports(int count, int lostPercent, int meanDelay) {
List<Transport> transports = new ArrayList<>(count);
int startPort = TransportConfig.DEFAULT_PORT;
for (int i = 0; i < count; i++) {
TransportConfig transportConfig = TransportConfig.builder().useNetworkEmulator(true).port(startPort).portCount(1000).build();
Transport transport = Transport.bindAwait(transportConfig);
transport.networkEmulator().setDefaultLinkSettings(lostPercent, meanDelay);
transports.add(transport);
startPort = transport.address().port() + 1;
}
return transports;
}
Aggregations