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 getLocalAddress()
Returns the local address.
 o getProtocol()
Returns the protocol.
 o getRemoteAddress()
Returns the peer address.
 o getType()
Returns the type.
 o init()
Initializes the module.
 o isInitialized()
Check whether the module is initialized.
 o isRemoteTelnetConfigured()
Check whether remoteTelnet is configured.
 o read()
Waits for and returns a message received on the ComPoint, which must be either an Initiator or a Responder.
 o toString()
Creates an string representation of the ComPoint.
 o write(Serializable)
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 isRemoteTelnetConfigured
 public static boolean isRemoteTelnetConfigured()
Check whether remoteTelnet is configured.

Returns:
true if and only if a proxy configured;
 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 getLocalAddress
 public ComPointAddress getLocalAddress()
Returns the local address. Note: we always return the canonical IP address for the host; this should be the most portable (e.g when sending a compointaddress from one host to another)

 o getRemoteAddress
 public ComPointAddress getRemoteAddress()
Returns the peer address. Note: we always return the canonical IP address for the host; this should be the most portable (e.g when sending a compointaddress from one host to another) Note: the remote address is not garantueed to be the correct one ! firewalls/proxies can result in a address which is not really the address of the original originator and doesn't allow a callback. In most cases though such situations anyway prevent callbacks almost completly ...

 o getComSocket
 public Object getComSocket()
Returns the comSocket.

 o toString
 public String toString()
Creates an string representation of the ComPoint.

Overrides:
toString in class Object
 o write
 public synchronized void write(Serializable 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 Serializable 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