|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetapp.Client
public class Client
A Client is what we'd think of as the typical program. In this case, the program doesn't do very much -- it just reads from a source and copies what it gets to a sink. That is, it does more or less what the *nix command 'cat' does.
There is somewhat more machinery in the code you'll find here than that requires, but you should ignore it. It has to do with reliably running repeated executions of the Client while trying to minimize the impact of Java on the results. The essence of a Client is simply "while my source has data, read it and write it to my sink."
Field Summary | |
---|---|
private byte[] |
buf
|
private static int |
BUFSIZE
|
long |
bytesSent
Used to compute timing statistics only. |
long |
elapsedTime
Used to compute timing statistics only. |
(package private) StopWatch |
watch
Used for statistics keeping. |
Constructor Summary | |
---|---|
Client()
Constructor: creates long-lived instance variables. |
Method Summary | |
---|---|
void |
go(DataSource src,
datasink.DataSink sink)
Run the Client. |
static void |
main(java.lang.String[] args)
main() handles the command line arguments, meaning it sets up the src and sink for the Client object. |
private static void |
printStats(int nTrials,
long elapsedTime,
long totalBytesSent,
long totalElapsedTime)
Helper function to print some statistics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public long elapsedTime
public long bytesSent
private static final int BUFSIZE
private byte[] buf
StopWatch watch
Constructor Detail |
---|
public Client()
Method Detail |
---|
public void go(DataSource src, datasink.DataSink sink)
private static void printStats(int nTrials, long elapsedTime, long totalBytesSent, long totalElapsedTime)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |