public final class TCPIPLink extends Link
It is perfectly possible for a user to create a TCPIPLink without going through the standard LinkFactory approach, although this is not recommended. For example:
TCPIPLink link = new TCPIPLink(address);
link.connect();
link.registerLink();
new ProcessManager(link).start();
Can be achieved using the LinkFactory:
link = LinkFactory.getLink(address);
The LinkFactory will create and start the Link automatically if required.
Link
,
TCPIPNodeAddress
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE
Defines the size of the buffer to place on the incoming and outgoing streams.
|
static boolean |
NAGLE
Flag to determine whether the Nagle algorithm should be activated.
|
Constructor and Description |
---|
TCPIPLink(TCPIPNodeAddress address)
Creates a new TCPIPLink
|
Modifier and Type | Method and Description |
---|---|
boolean |
connect()
Connects the Link to the remote Node.
|
protected boolean |
createResources()
Creates any required resources.
|
protected void |
destroyResources()
Destroys any resources used by the Link
|
NodeAddress |
getRemoteAddress()
Gets the NodeAddress of the Node that this Link is connected to
|
getRemoteNodeID, getTxChannel, lostLink, registerLink, run
public static int BUFFER_SIZE
public static boolean NAGLE
public TCPIPLink(TCPIPNodeAddress address) throws JCSPNetworkException
address
- The address of the remote Node to connect toJCSPNetworkException
- Thrown if something goes wrong during the creation processpublic boolean connect() throws JCSPNetworkException
connect
in class Link
JCSPNetworkException
- Thrown if something goes wrong during the connectionprotected boolean createResources() throws JCSPNetworkException
createResources
in class Link
JCSPNetworkException
- Thrown if anything goes wrong during the creation process.protected void destroyResources()
destroyResources
in class Link
public NodeAddress getRemoteAddress()
Copyright © 1996–2018. All rights reserved.