org.openmuc.j60870
public class ServerSap extends java.lang.Object
Constructor and Description |
---|
ServerSap(int port,
int backlog,
java.net.InetAddress bindAddr,
javax.net.ServerSocketFactory serverSocketFactory,
ServerSapListener connectionListener)
Use this constructor to create a ServerSAP that can listen on a port with a specified ServerSocketFactory.
|
ServerSap(int port,
ServerSapListener connectionListener)
Use this constructor to create a ServerSAP that listens on the given port using the default ServerSocketFactory.
|
ServerSap(ServerSapListener connectionListener)
Use this constructor to create a ServerSAP that listens on port 2404 using the default ServerSocketFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
setAddressFieldLength(int length)
Sets the length of the Common Address field of the ASDU.
|
void |
setCotFieldLength(int length)
Sets the length of the Cause Of Transmission field of the ASDU.
|
void |
setIoaFieldLength(int length)
Sets the length of the Information Object Address field of the ASDU.
|
void |
setMaxConnections(int maxConnections)
Set the maximum number of client connections that are allowed in parallel.
|
void |
setMessageFragmentTimeout(int timeout)
Sets the message fragment timeout.
|
void |
startListening()
Starts a new thread that listens on the configured port.
|
public ServerSap(ServerSapListener connectionListener)
connectionListener
- the ServerConnectionListener that will be notified when remote clients are connecting or the server
stopped listening.public ServerSap(int port, ServerSapListener connectionListener)
port
- the TCP port that the server will listen on. IEC 60870-5-104 usually uses port 2404.connectionListener
- the ServerConnectionListener that will be notified when remote clients are connecting or the server
stopped listening.public ServerSap(int port, int backlog, java.net.InetAddress bindAddr, javax.net.ServerSocketFactory serverSocketFactory, ServerSapListener connectionListener)
port
- the TCP port that the server will listen on. IEC 60870-5-104 usually uses port 2404.backlog
- is passed to the java.net.ServerSocketbindAddr
- the IP address to bind to. It is passed to java.net.ServerSocketserverSocketFactory
- The ServerSocketFactory to be used to create the ServerSocketconnectionListener
- the ServerConnectionListener that will be notified when remote clients are connecting or the server
stopped listening.public void setMessageFragmentTimeout(int timeout)
timeout
- the timeout in milliseconds. The default is 10000.public void setCotFieldLength(int length)
length
- the length of the Cause Of Transmission fieldpublic void setAddressFieldLength(int length)
length
- public void setIoaFieldLength(int length)
length
- the length of the Information Object Address fieldpublic void setMaxConnections(int maxConnections)
maxConnections
- the number of connections allowed (default is 100)public void startListening() throws java.io.IOException
java.io.IOException