runAllCombinations(new Checker()
{
@Override
public void check(int port, boolean localhost, long batchOutgoingMessagesDelayMillis) throws Throwable
{
final StatsCollector statsCollector = new StatsCollectorFactoryCoda().createStatsCollector(new ClusterId("test", "test-cluster"), new Destination(){});
// we're going to batch no matter what the parameter says.
batchOutgoingMessagesDelayMillis = 10000;
SenderFactory factory = null;
TcpReceiver adaptor = null;
try
{
//===========================================
// setup the sender and receiver
adaptor = new TcpReceiver(null,getFailFast());
adaptor.setStatsCollector(statsCollector);
StringListener receiver = new StringListener();
adaptor.setListener(receiver);
// we want to keep track of the number of bytes written
final long[] flushByteCounts = new long[4]; // This should be all that's needed
factory = makeSenderFactory(new BatchingOutputStreamWatcher(flushByteCounts),
statsCollector,batchOutgoingMessagesDelayMillis);
if (port > 0) adaptor.setPort(port);
if (localhost) adaptor.setUseLocalhost(localhost);
//===========================================
adaptor.start(); // start the adaptor
Destination destination = adaptor.getDestination(); // get the destination
// send a message
Sender sender = factory.getSender(destination);
int mtu = ((TcpSender)sender).getMtu();