Class semper.transfer.PortManager
All Packages Class Hierarchy This Package Previous Next Index
Class semper.transfer.PortManager
java.lang.Object
|
+----semper.transfer.PortManager
- public class PortManager
- extends Object
The PortManager class provides the management of different ports for different entities.
This class can not be instantiated, all methods are static. This is necessary because it
handles with service points of the communication block.
For each port only one ServicePointThread
can be opened. For this reason it is not possible to start two processes using the same
ports (e.g. two clients or client and server).
If you like to start two ore more clients they have to be threads in one process.
-
PortManager()
-
-
getServicePoint(int)
- Request for a service point on certain port.
-
isServicePoint(int)
- Method to control if a port is yet in use by a ServicePointThread.
-
openServicePoint(int)
- Opening a new Service Point.
PortManager
public PortManager()
isServicePoint
protected static synchronized int isServicePoint(int port)
- Method to control if a port is yet in use by a ServicePointThread.
Returns ant int that is the index of this port in the __servicePoints Vector.
If this port has no Thread the return value is -1.
openServicePoint
public static synchronized void openServicePoint(int port) throws TransferServiceException
- Opening a new Service Point. It has to be synchronized to guarantee corresponding indexes
in the port and service point vectors.
getServicePoint
public static synchronized ChannelServicePointThread getServicePoint(int port) throws TransferServiceException
- Request for a service point on certain port. If not yet opened, a new thread is started.
All Packages Class Hierarchy This Package Previous Next Index