Class semper.comm.ComPointTCP
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.comm.ComPointTCP

java.lang.Object
   |
   +----semper.comm.ComPointTCP

public class ComPointTCP
extends Object
implements ComPoint
This class implements the ComPoint class based on tcp.
Version:
beta-4, 12.8.96
Author:
Mehdi Nassehi

Constructor Index

 o ComPointTCP()
Creats a ComPointTCP.
 o ComPointTCP(int, ComPointAddress)
Creats an initiator or server ComPointTCP.

Method Index

 o accept()
Waits for and returns a Responder ComPoint when a message arrives.
 o close()
Closes the ComPointTCP.
 o comPoint(int, ComPointAddress)
Creats an Initiator or Server ComPointTCP cast into ComPoint.
 o finalize()
Finalizer.
 o getAddress()
Returns the address.
 o getComSocket()
Returns the comSocket.
 o getProtocol()
Returns the protocol.
 o getType()
Returns the type.
 o init()
Initializes the module.
 o isInitialized()
Check whether the module is initialized.
 o read()
Waits for and returns a message received on the ComPoint, which must be either an Initiator or a Responder.
 o write(Object)
Sends the message through the ComPoint, which must be either an Initiator or a Responder.

Constructors

 o ComPointTCP
  public ComPointTCP()
Creats a ComPointTCP.
 o ComPointTCP
  public ComPointTCP(int type,
                     ComPointAddress address) throws ComPointException
Creats an initiator or server ComPointTCP.
Parameters:
type - type of ComPointTCP to be created
address - if the type is server, the local address; otherwise, the remote address.
Throws: ComPointException
if type is invalid or the socket cannot be opened.

Methods

 o init
  public static void init()
Initializes the module.
 o isInitialized
  public static boolean isInitialized()
Check whether the module is initialized.
Returns:
true if and only if fully initialized;
 o comPoint
  public ComPoint comPoint(int type,
                           ComPointAddress address) throws ComPointException
Creats an Initiator or Server ComPointTCP cast into ComPoint.
Parameters:
type - type of ComPointTCP to be created
address - if the type is server, the local address; otherwise, the remote address.
Throws: ComPointException
if type is invalid or the socket cannot be opened.
 o close
  public void close() throws ComPointException
Closes the ComPointTCP.
Throws: ComPointException
if type is invalid or encountered an error while error while closing the socket.
 o finalize
  protected void finalize()
Finalizer.
Overrides:
finalize in class Object
 o getProtocol
  public String getProtocol()
Returns the protocol.
 o getType
  public int getType()
Returns the type.
 o getAddress
  public ComPointAddress getAddress()
Returns the address.
 o getComSocket
  public Object getComSocket()
Returns the comSocket.
 o write
  public synchronized void write(Object message) throws ComPointException
Sends the message through the ComPoint, which must be either an Initiator or a Responder.
Parameters:
message - message to be sent.
Throws: ComPointException
if the type is invalid or encountered an error while externalizing the message.
 o read
  public synchronized Object read() throws ComPointException
Waits for and returns a message received on the ComPoint, which must be either an Initiator or a Responder.
Throws: ComPointException
if the type is invalid or encountered an error while internalizing the message.
 o accept
  public synchronized ComPoint accept() throws ComPointException
Waits for and returns a Responder ComPoint when a message arrives. Must be invoked on a ComPoint of type Server.
Throws: ComPointException
if the type is invalid or encountered an error while accepting a new socket.

All Packages  Class Hierarchy  This Package  Previous  Next  Index