add 20kmtu option for udp

TODO: double check binary
This commit is contained in:
HappyZ 2017-02-23 02:33:52 -08:00
parent c798645414
commit 271ef8d398
2 changed files with 13 additions and 4 deletions

View File

@ -518,7 +518,7 @@ class MainActivity extends Activity {
+ (bytes2send / 1024) + "KB_"
+ repeatCounts + "repeats_thrpt_"
+ (currentBandwidth == -1 ? "Unlimited" :
(currentBandwidth / 1000000.0) + "MBps_")
(currentBandwidth / 1000000.0) + "Mbps_")
+ (new SimpleDateFormat(
"yyyyMMdd_HHmmss", Locale.US)
.format(new Date()))
@ -793,10 +793,11 @@ class MainActivity extends Activity {
CharSequence[] items = {
"Verbose Mode", "Only Run Locally", "CPULog (Per Proc)",
"CPULog (WiFi Driver)", "CPULog (This App)", "CPULog (TCPDump)",
"Force on CPU0"};
"Force on CPU0", "20kMTU for UDP"};
boolean[] checkedItems = {
isVerbose, isLocal, isLoggingPerProcPID, (wifiDriverPID != -1),
isLoggingAppSelf, isLoggingTCPDump, isForcingCPU0};
isLoggingAppSelf, isLoggingTCPDump, isForcingCPU0,
(Utilities.udpsendsize != -1)};
AlertDialog.Builder adb = new AlertDialog.Builder(MainActivity.this);
adb.setMultiChoiceItems(items, checkedItems, new DialogInterface.OnMultiChoiceClickListener() {
@Override
@ -860,6 +861,13 @@ class MainActivity extends Activity {
(isForcingCPU0 ? "Force on cpu 0" : "Will run on any cpu"),
Toast.LENGTH_SHORT).show();
break;
case 7:
Utilities.udpsendsize = isChecked ? 20000: -1;
Toast.makeText(MainActivity.this,
(Utilities.udpsendsize != -1) ?
"udp mtu to 20k" : "1.5k mtu for udp",
Toast.LENGTH_SHORT).show();
break;
}
}
});

View File

@ -36,6 +36,7 @@ class Utilities {
static final int oneMB = 1048576;
static int TCP_port = 4444;
static int UDP_port = 8888;
static int udpsendsize = -1;
static String myInetIP = null;
static String myMAC = null;
private static boolean screenIsOff = false;