public class RandomLossGenerator extends java.lang.Object implements LossGenerator
Constructor and Description |
---|
RandomLossGenerator(double lossRate)
Construct loss generator with given loss rate as percentage.
|
RandomLossGenerator(double lossRate,
long lossSeed)
Construct loss generator with given loss rate as percentage and random seed
|
Modifier and Type | Method and Description |
---|---|
boolean |
shouldDropFrame(java.net.InetSocketAddress address,
org.agrona.concurrent.UnsafeBuffer buffer,
int length)
Should a frame be dropped?
|
public RandomLossGenerator(double lossRate)
lossRate
- for generating losspublic RandomLossGenerator(double lossRate, long lossSeed)
lossRate
- for generating losslossSeed
- for random seedingpublic boolean shouldDropFrame(java.net.InetSocketAddress address, org.agrona.concurrent.UnsafeBuffer buffer, int length)
LossGenerator
shouldDropFrame
in interface LossGenerator
address
- The source address of the frame if inbound or the remote address if outbound.buffer
- The buffer containing the frame data.length
- The length of the frame.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.