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
-
ComPointTCP()
- Creats a ComPointTCP.
-
ComPointTCP(int, ComPointAddress)
- Creats an initiator or server ComPointTCP.
-
accept()
- Waits for and returns a Responder ComPoint when a message arrives.
-
close()
- Closes the ComPointTCP.
-
comPoint(int, ComPointAddress)
- Creats an Initiator or Server ComPointTCP cast into ComPoint.
-
finalize()
- Finalizer.
-
getAddress()
- Returns the address.
-
getComSocket()
- Returns the comSocket.
-
getLocalAddress()
- Returns the local address.
-
getProtocol()
- Returns the protocol.
-
getRemoteAddress()
- Returns the peer address.
-
getType()
- Returns the type.
-
init()
- Initializes the module.
-
isInitialized()
- Check whether the module is initialized.
-
isRemoteTelnetConfigured()
- Check whether remoteTelnet is configured.
-
read()
- Waits for and returns a message received on the ComPoint, which
must be either an Initiator or a Responder.
-
toString()
- Creates an string representation of the ComPoint.
-
write(Serializable)
- Sends the message through the ComPoint, which must be either
an Initiator or a Responder.
ComPointTCP
public ComPointTCP()
- Creats a ComPointTCP.
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.
init
public static void init()
- Initializes the module.
isInitialized
public static boolean isInitialized()
- Check whether the module is initialized.
- Returns:
- true if and only if fully initialized;
isRemoteTelnetConfigured
public static boolean isRemoteTelnetConfigured()
- Check whether remoteTelnet is configured.
- Returns:
- true if and only if a proxy configured;
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.
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.
finalize
protected void finalize()
- Finalizer.
- Overrides:
- finalize in class Object
getProtocol
public String getProtocol()
- Returns the protocol.
getType
public int getType()
- Returns the type.
getAddress
public ComPointAddress getAddress()
- Returns the address.
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)
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 ...
getComSocket
public Object getComSocket()
- Returns the comSocket.
toString
public String toString()
- Creates an string representation of the ComPoint.
- Overrides:
- toString in class Object
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.
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.
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