??????????????????????????????
???????????????£???????δ????а????????С??????????У?????????wifi???????????????2?????????????????????????
??????ù?????飬???????а??????????????????????20KB????????????????2.36KB??
????????????????
????????????????APP??????????????????????APP???????????£????????????????????
?????????????????
??????ù????????????
????· ???Adb????????????TesterHome??????????????????????????????? ??????? ??
????· ???tcpdump????????wireshark??????
????· ?????????????GT??Wetest??Emmagee??????????????????????
????· ??????????д?????????????????
????????Ч????
???????GT??????????????????????????????csv???????????????????????????????
transmittedreceived
min19108
max22137
avg21132
11:41:15.219108
11:41:16.420111
11:41:17.521136
11:41:18.722136
11:41:19.822137
11:41:21.022137
?????????????????????????????????????????????????????????????????????????????в???????????????????????????
????tcpdump+wireshark??????????????????????????????????????????????????????????
?????????????
???????????????????????????????????????????????????????????
????????????
?????????????????????????????????????????????????????????????????????????????
??????????????????????
public class TrafficCount {
private static Queue<string> trafficInfo = new Queue<string>();
public static void Add(string s) {
trafficInfo.Enqueue(s);
}
public static void WriteToFile(string filePath) {
StreamWriter sw = new StreamWriter(filePath);
foreach(var i in trafficInfo) {
sw.WriteLine(i);
}
sw.Close();
Debug.LogWarning("???????");
}
???????????????????????????????????????(??????????????????????????????????????????????????????)
SocketError error;
var sended = mSocket.Send(output?? SocketFlags.None?? out error);
if (error == SocketError.Success) {
obj.OK();
//??????
this.Debug("??????? {0} ???????"?? sended);
TrafficCount.Add("???????"+ sended + "???????");
//??????
} else {
obj.Error();
this.Error("???????????: {0}"?? error.ToString());
}
????????????????????MonoBehaviour???????????????????????
void OnGUI() {
if (GUI.Button(new Rect(0?? (Screen.height/2)?? 50?? 30)?? "????????")) {
//?????????????????????????????Э???
EventHelper.Ins.Get<SystemEventGroup>().onRequest.AddHandler((ss?? req) => {
Debug.Log(req.Protocol);
TrafficCount.Add(req.Protocol.ToString());
});
EventHelper.Ins.Get<SystemEventGroup>().onResponse.AddHandler((ss?? req) => {
Debug.Log(req.Protocol+"???????");
TrafficCount.Add(req.Protocol + "???????");
});
}
if (GUI.Button(new Rect(0?? (Screen.height/2)+50?? 50?? 30)?? "????")) {
TrafficCount.WriteToFile(@"C:VSTest esult.txt");
}
}
?????????????????
110101
???????77???????
???????55???????
110101???????
107501
???????84???????
???????28???????
107501???????
??????????
????· ????????????????????????а??????????????????????????????????????????????
????· ??Щ??????????ε????????????????????а?????????ε??????????????????????????????а?????????л?????????????????????????????
????????
?????????????????????????????????GT???????
????????Э??????????????????????????????