Package org.jcsp.net2.tcpip
Class TCPIPLinkServer
- java.lang.Object
-
- org.jcsp.net2.LinkServer
-
- org.jcsp.net2.tcpip.TCPIPLinkServer
-
- All Implemented Interfaces:
CSProcess
public final class TCPIPLinkServer extends LinkServer
Concrete implementation of a LinkServer that listens on a TCP/IP based ServerSocket. For information on LinkServer, see the relevant documentation.It is possible for an advanced user to create this object themselves, although it is not recommended. For example:
TCPIPLinkServer serv = new TCPIPLinkServer(address);
new ProcessManager(serv).start();This is done automatically during Node initialisation. However, if the machine used has multiple interfaces, this can be used to listen on another interface also.
- See Also:
LinkServer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TCPIPNodeAddress
listeningAddress
The NodeAddress that this LinkServer is listening on.private java.net.ServerSocket
serv
The ServerSocket that this class wraps around.
-
Constructor Summary
Constructors Constructor Description TCPIPLinkServer(java.net.ServerSocket serverSocket)
Creates LinkServer by wrapping round an existing ServerSocket.TCPIPLinkServer(TCPIPNodeAddress address)
Creates a new TCPIPLinkServer listening on the given address
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
The run method for the TCPIPLinkServer process-
Methods inherited from class org.jcsp.net2.LinkServer
registerLink, requestLink, start
-
-
-
-
Field Detail
-
serv
private final java.net.ServerSocket serv
The ServerSocket that this class wraps around. The process listens on this connection
-
listeningAddress
final TCPIPNodeAddress listeningAddress
The NodeAddress that this LinkServer is listening on. This should be the same as the Node's address.
-
-
Constructor Detail
-
TCPIPLinkServer
TCPIPLinkServer(java.net.ServerSocket serverSocket)
Creates LinkServer by wrapping round an existing ServerSocket. Used internally by JCSP- Parameters:
serverSocket
- The ServerSocket to create the LinkServer with
-
TCPIPLinkServer
public TCPIPLinkServer(TCPIPNodeAddress address) throws JCSPNetworkException
Creates a new TCPIPLinkServer listening on the given address- Parameters:
address
- The address to listen on for new connections- Throws:
JCSPNetworkException
- Thrown if something goes wrong during the creation of the ServerSocket
-
-