Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r708 committed - Add client app identifier.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r708 committed - Add client app identifier.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r708 committed - Add client app identifier.
  • Date: Tue, 11 Oct 2011 17:32:37 +0000

Revision: 708
Author:

Date: Tue Oct 11 10:32:07 2011
Log: Add client app identifier.
http://code.google.com/p/ndt/source/detail?r=708

Modified:
/branches/android/Android/src/net/measurementlab/ndt/NdtService.java
/branches/android/java/Tcpbw100_msgs_en_US.properties
/branches/android/java/net/measurementlab/ndt/NdtTests.java
/branches/android/java/net/measurementlab/ndt/UiServices.java

=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/NdtService.java Tue Aug 23 14:09:58 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/NdtService.java Tue Oct 11 10:32:07 2011
@@ -352,5 +352,10 @@
void requestStop() {
wantToStop = true;
}
+
+ @Override
+ public String getClientApp() {
+ return "mobile_android";
+ }
}
}
=======================================
--- /branches/android/java/Tcpbw100_msgs_en_US.properties Fri Jun 10 09:17:33 2011
+++ /branches/android/java/Tcpbw100_msgs_en_US.properties Tue Oct 11 10:32:07 2011
@@ -100,6 +100,10 @@
loggingWrongMessage = Logging to server: Received wrong type of the message
lookupError = Unable to obtain remote IP address
mboxWrongMessage = Middlebox test: Received wrong type of the message
+meta = META
+metaFailed = META test FAILED!
+metaTest = META test...
+metaWrongMessage = META test: Received wrong type of the message
middlebox = Middlebox
middleboxFail = Server Failed while middlebox testing
middleboxFail2 = Middlebox test FAILED!
@@ -156,6 +160,7 @@
sackReceived = SACK blocks received
scalingFactors = Scaling Factors
seconds = seconds
+sendingMetaInformation = Sending META information . . . . . . . . . . . . . . . . . . .
server = Server
serverAcksReport = Server Acks report link is
serverFault = Server Fault: unknown fault occurred. Please try again later
=======================================
--- /branches/android/java/net/measurementlab/ndt/NdtTests.java Tue Aug 23 13:36:59 2011
+++ /branches/android/java/net/measurementlab/ndt/NdtTests.java Tue Oct 11 10:32:07 2011
@@ -80,6 +80,13 @@
private static final byte TEST_S2C = (1 << 2);
private static final byte TEST_SFW = (1 << 3);
private static final byte TEST_STATUS = (1 << 4);
+ private static final byte TEST_META = (1 << 5);
+
+ private static final String META_CLIENT_OS = "client.os.name";
+ private static final String META_BROWSER_OS = "client.browser.name";
+ private static final String META_CLIENT_KERNEL_VERSION = "client.kernel.version";
+ private static final String META_CLIENT_VERSION = "client.version";
+ private static final String META_CLIENT_APPLICATION = "client.application";

/* we really should do some clean-up in this java code... maybe later ;) */
private static final byte COMM_FAILURE = 0;
@@ -134,7 +141,7 @@
double aspd;

String tmpstr, tmpstr2;
- byte tests = TEST_MID | TEST_C2S | TEST_S2C | TEST_SFW | TEST_STATUS;
+ byte tests = TEST_MID | TEST_C2S | TEST_S2C | TEST_SFW | TEST_STATUS | TEST_META;
int c2sResult = SFW_NOTTESTED;
int s2cResult = SFW_NOTTESTED;

@@ -776,6 +783,66 @@
}
return false;
}
+
+ public boolean test_meta(Protocol ctl, String application) throws IOException
+ {
+ Message msg = new Message();
+ if ((tests & TEST_META) == TEST_META) {
+ showStatus(messages.getString("metaTest"));
+ results.append(messages.getString("sendingMetaInformation") + " ");
+ statistics.append(messages.getString("sendingMetaInformation") + " ");
+ emailText += messages.getString("sendingMetaInformation") + " ";
+
+ if (ctl.recv_msg(msg) != 0) {
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
+ return true;
+ }
+ if (msg.type != TEST_PREPARE) {
+ errmsg = messages.getString("metaWrongMessage") + "\n";
+ if (msg.type == MSG_ERROR) {
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
+ }
+ return true;
+ }
+
+ if (ctl.recv_msg(msg) != 0) {
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
+ return true;
+ }
+ if (msg.type != TEST_START) {
+ errmsg = messages.getString("metaWrongMessage") + "\n";
+ if (msg.type == MSG_ERROR) {
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
+ }
+ return true;
+ }
+
+ ctl.send_msg(TEST_MSG, (META_CLIENT_OS + ":" + System.getProperty("os.name")).getBytes());
+ ctl.send_msg(TEST_MSG, (META_BROWSER_OS + ":" + "na").getBytes());
+ ctl.send_msg(TEST_MSG, (META_CLIENT_KERNEL_VERSION + ":" + System.getProperty("os.version")).getBytes());
+ ctl.send_msg(TEST_MSG, (META_CLIENT_VERSION + ":" + VERSION).getBytes());
+ ctl.send_msg(TEST_MSG, (META_CLIENT_APPLICATION + ":" + application).getBytes());
+
+ ctl.send_msg(TEST_MSG, new byte[0]);
+
+ if (ctl.recv_msg(msg) != 0) {
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
+ return true;
+ }
+ if (msg.type != TEST_FINALIZE) {
+ errmsg = messages.getString("metaWrongMessage");
+ if (msg.type == MSG_ERROR) {
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
+ }
+ return true;
+ }
+ results.append(messages.getString("done") + "\n");
+ statistics.append(messages.getString("done") + "\n");
+ emailText += messages.getString("done") + "\n%0A";
+ }
+
+ return false;
+ }

private void dottcp() throws IOException {
Socket ctlSocket = null;
@@ -954,6 +1021,14 @@
tests &= (~TEST_S2C);
}
uiServices.incrementProgress();
+ break;
+ case TEST_META:
+ uiServices.updateStatusPanel(messages.getString("meta"));
+ if (test_meta(ctl, uiServices.getClientApp())) {
+ results.append(errmsg);
+ results.append(messages.getString("metaFailed") + "\n");
+ tests &= (~TEST_META);
+ }
break;
default:
errmsg = messages.getString("unknownID") + "\n";
=======================================
--- /branches/android/java/net/measurementlab/ndt/UiServices.java Wed Jun 9 15:23:05 2010
+++ /branches/android/java/net/measurementlab/ndt/UiServices.java Tue Oct 11 10:32:07 2011
@@ -120,6 +120,8 @@
*/
// TODO: remove this polling, change to a listener or something cleaner
public boolean wantToStop();
+
+ public String getClientApp();

// Hack for the Applet's JavaScript access API extension
public void setVariable(String name, int value);


  • [ndt-dev] [ndt] r708 committed - Add client app identifier., ndt, 10/11/2011

Archive powered by MHonArc 2.6.16.

Top of Page