{//set NMEcho control standard TCP/IP properties
NMEcho1 -> Host=Edit1 -> Text;
NMEcho1 -> TimeOut=StrToInt (Edit2 -> Text);
If (CheckBox1 -> Checked)
NMEcho1 -> Port=StrToInt (Edit3 -> Text);
The else
NMEcho1 -> Port=7;
//Echo in the TCP/IP default port
NMEcho1 -> ReportLevel=Status_Basic;
NMEcho1 -> the Connect ();//connect
RichEdit2 -> Clear ();
for(int i=0; I
//RichEdit1 used to send information to a remote host
RichEdit2 -> Text=RichEdit2 -> Text + NMEcho1 -> Echo (RichEdit1 -> Lines ->
Strings [I]);
NMEcho1 -> Disconnect ();
}
This is I find using c + + Builder to realize the Internet network connection part of the test procedure code this code not understand superior resolution; for(int i=0; I
CodePudding user response:
Echo is a TCP protocol to write back and forth with you sent to the server string,Method to measure the network connection with ping is better, can use the indy ICMP component implementation
CodePudding user response:
The code above this paragraph for (int I=0; I was not complete, can help to see how to fillCodePudding user response:
It should beFor (int I=0; i
http://download.csdn.net/detail/geoff08zhang/4571358
CodePudding user response:
I also wrote about the code below. Put the code on the thread to run.
The ICMP - & gt; The Host=IP;
The ICMP - & gt; PacketSize=32;
The ICMP - & gt; ReceiveTimeout=2000;
The ICMP - & gt; Ping ();
The ICMP - & gt; OnReply=ICMPReply;
//event back ping take
Void __fastcall Ping: ICMPReply (TComponent * ASender, const TReplyStatus * AReplyStatus)
{
Times=AReplyStatus - & gt; MsRoundTripTime;
}