CS101 Package Problem Set Javadocs

cs101.net
Class ClientWire

java.lang.Object
  extended bycs101.net.ClientWire
All Implemented Interfaces:
Wire

public class ClientWire
extends java.lang.Object
implements Wire

Networked Wire, Client Side. Provides readObject, writeObject.

If server's hostName and port are not provided at creation time, the user is prompted for this information using ClientDialog.

Copyright 1996 Massachusetts Institute of Technology

Version:
$Id: ClientWire.java,v 1.3 2003/11/03 19:00:06 gus Exp $
Author:
Todd C. Parnell, tparnell@ai.mit.edu, Maciej Stachowiak, maciej@ai.mit.edu, Lynn Andrea Stein, las@ai.mit.edu
See Also:
Wire, ServerWire

Constructor Summary
ClientWire()
          How to make one, if we don't know who we want to talk to.
ClientWire(java.lang.String hostName, int port)
          How to make one, if we know who we want to talk to.
ClientWire(java.lang.String hostName, int port, boolean verbose)
          How to make one, if we know who we want to talk to.
 
Method Summary
protected  void connectTo(java.lang.String hostName, int port)
          Opens a connection to a server presumed to be listening on hostName, port.
 void finalize()
          Closes the Socket and Streams.
 java.lang.Object readObject()
          Use this to read an Object from the Wire.
 void writeObject(java.lang.Object o)
          Use this method to write an Object to the Wire.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientWire

public ClientWire(java.lang.String hostName,
                  int port,
                  boolean verbose)
How to make one, if we know who we want to talk to. Specify verboseness.

Parameters:
hostName - the name of the machine that the server is on
port - the port number on which the server is listening
verbose - specify verboseness level

ClientWire

public ClientWire(java.lang.String hostName,
                  int port)
How to make one, if we know who we want to talk to. Verbosness on.

Parameters:
hostName - the name of the machine that the server is on
port - the port number on which the server is listening

ClientWire

public ClientWire()
How to make one, if we don't know who we want to talk to. Uses ClientDialog to ask user. Verboseness on.

Method Detail

connectTo

protected void connectTo(java.lang.String hostName,
                         int port)
Opens a connection to a server presumed to be listening on hostName, port. Sets up listener thread. Called by constructor; should not be called otherwise.

Parameters:
hostName - the name of the machine that the server is on
port - the port number on which the server is listening

readObject

public java.lang.Object readObject()
Use this to read an Object from the Wire.

Specified by:
readObject in interface Wire
Returns:
the Object read.

writeObject

public void writeObject(java.lang.Object o)
Use this method to write an Object to the Wire.

Specified by:
writeObject in interface Wire
Parameters:
o - The object to be written.

finalize

public void finalize()
Closes the Socket and Streams.


CS101 Package Problem Set Javadocs