public class ServerTSap
extends java.lang.Object
Constructor | Description |
---|---|
ServerTSap(int port,
int backlog,
java.net.InetAddress bindAddr,
TConnectionListener conListener) |
Use this constructor to create a server TSAP that can listen on a port.
|
ServerTSap(int port,
int backlog,
java.net.InetAddress bindAddr,
TConnectionListener connectionListener,
javax.net.ServerSocketFactory serverSocketFactory) |
Use this constructor to create a server TSAP that can listen on a port, with a specified
ServerSocketFactory.
|
ServerTSap(int port,
TConnectionListener conListener) |
Use this constructor to create a server TSAP that can listen on a port.
|
Modifier and Type | Method | Description |
---|---|---|
static int |
getMaxTPDUSize(int maxTPDUSizeParam) |
Calculates and returns the maximum TPDUSize.
|
int |
getMaxTPDUSizeParam() |
Get the maximum TPDU size parameter to be used by this TSAP
|
void |
setMaxConnections(int maxConnections) |
Set the maximum number of connections that are allowed in parallel by the Server SAP.
|
void |
setMaxTPDUSizeParam(int maxTPDUSizeParam) |
Set the maxTPDUSize.
|
void |
setMessageFragmentTimeout(int messageFragmentTimeout) |
Set the TConnection timeout for receiving data once the beginning of a message has been
received.
|
void |
setMessageTimeout(int messageTimeout) |
Set the TConnection timeout for waiting for the first byte of a new message.
|
void |
startListening() |
Starts a new thread that listens on the configured port.
|
void |
stopListening() |
Stop listing on the port.
|
public ServerTSap(int port, TConnectionListener conListener)
port
- the TCP port that the ServerSocket will connect to. Should be between 1 and 65535.conListener
- the ConnectionListener that will be notified when remote TSAPs are
connecting or the server stopped listening.public ServerTSap(int port, int backlog, java.net.InetAddress bindAddr, TConnectionListener conListener)
port
- the TCP port that the ServerSocket will connect to. Should be between 1 and 65535.conListener
- the ConnectionListener that will be notified when remote TSAPs are
connecting or the server stopped listening.backlog
- is passed to the java.net.ServerSocketbindAddr
- the IP address to bind to. It is passed to java.net.ServerSocketpublic ServerTSap(int port, int backlog, java.net.InetAddress bindAddr, TConnectionListener connectionListener, javax.net.ServerSocketFactory serverSocketFactory)
port
- the TCP port that the ServerSocket will connect to. Should be between 1 and 65535.connectionListener
- the ConnectionListener that will be notified when remote TSAPs are
connecting or the server stopped listening.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 ServerSocketpublic static int getMaxTPDUSize(int maxTPDUSizeParam)
maxTPDUSizeParam
- the size parameterpublic void startListening() throws java.io.IOException
java.io.IOException
- if a starting to listen failspublic void stopListening()
public void setMaxConnections(int maxConnections)
maxConnections
- the number of connections allowed (default is 100)public void setMessageTimeout(int messageTimeout)
messageTimeout
- in millisecondspublic void setMessageFragmentTimeout(int messageFragmentTimeout)
messageFragmentTimeout
- in millisecondspublic int getMaxTPDUSizeParam()
public void setMaxTPDUSizeParam(int maxTPDUSizeParam)
maxTPDUSizeParam
- The maximum length is equal to 2^(maxTPDUSizeParam) octets. Note that
the actual TSDU size that can be transfered is equal to TPduSize-3. Default is 65531 octets
(see RFC 1006), 7 <= maxTPDUSizeParam <= 16, needs to be set before listening or
connecting