SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 42 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

MaxValue; // unlimited, in effect
int interval = 1;
string command = "T"; // get temperature sample
string units = "F";
double temperature;
IPHostEntry iphe; // for checking host address string
#region Check and process command line arguments (code not shown)
Client client = new Client();
client.Socket();
client.Connect(host,port);
for (int i = 0; i < nsamples; i++)
{
client.Send(command);
temperature = client.Receive();
if (units == "C")
temperature = Temperature.ConvertToCelsius(temperature);
Console.WriteLine("{0:u} Temperature server at {1} " +
"port {2} reports {3,5:F1} {4}",
DateTime.Now, host, port, temperature,units);
client.Sleep(interval);
}
client.Close();
}
}
}
Figure 2.8. Temperature logger, a client application.
Overview 23
control structure (sequences, loops, and conditional statements) that implement our
protocol, and also provide data (such as IP addresses and port numbers) used by the
libraries.
When an application is compiled, it references the libraries it uses: the compiler
consults the library assemblies for information it needs. This command compiles
the Monitor application, which uses the Server and Temperature libraries.
csc /target:exe /reference:Server.dll,Temperature.dll Monitor.cs
In the .NET framework, an application is an assembly that contains a main
method. It has the file type exe. The application assembly does not contain the
compiled code of the libraries it uses.


Pages:
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6