CS101 Package Problem Set Javadocs

cs101.net
Class ServerWire

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

public class ServerWire
extends java.lang.Object
implements Wire

Networked Wire, Server Side. Provides readObject, writeObject.

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

Copyright 1996 Massachusetts Institute of Technology

Version:
$Id: ServerWire.java,v 1.2 2003/10/28 21:41:15 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, ClientWire

Constructor Summary
ServerWire()
          How to make one, if we don't know who we want to talk to.
ServerWire(int port)
          How to make one, if we know the port.
ServerWire(int port, boolean verbose)
          How to make one, if we know the port.
 
Method Summary
protected  void connectTo(int port)
          Opens a connection to a server presumed to be listening on hostName, port.
 void finalize()
          Closes the Socket.
 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

ServerWire

public ServerWire(int port,
                  boolean verbose)
How to make one, if we know the port. Control verbosity.

Parameters:
port - the port number to listen on
verbose - toggle verbosity

ServerWire

public ServerWire(int port)
How to make one, if we know the port. Verbose mode.

Parameters:
port - the port number to listen on

ServerWire

public ServerWire()
How to make one, if we don't know who we want to talk to. Uses ServerDialog to ask user. Verbose mode.

Method Detail

connectTo

protected void connectTo(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:
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.


CS101 Package Problem Set Javadocs