|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openmuc.jsml.tl.SML_TSAP
public class SML_TSAP
This class implements the SML Transport Layer Service Access Point (TSAP) for the use of SML over TCP/IP. It can be used by a client to create SML_TConnections as well as by a Server to listen for SML_TConnections
Constructor Summary | |
---|---|
SML_TSAP()
Use this constructor to create a client SML_TSAP that can be used to start a connection to a remote SML server. |
|
SML_TSAP(int port,
SML_TConnectionListener conListener)
Use this constructor to create a server TSAP that can listen on a port. |
|
SML_TSAP(int port,
SML_TConnectionListener conListener,
javax.net.ServerSocketFactory serverSocketFactory)
Use this constructor to create a server TSAP that can listen on a port, with a specified ServerSocketFactory. |
|
SML_TSAP(javax.net.SocketFactory socketFactory)
Use this constructor to create a client SML_TSAP that can be used to start a connection to a remote SML server. |
Method Summary | |
---|---|
SML_TConnection |
connectTo(java.net.InetAddress address,
int port)
Connect to a remote TSAP that is listening at the destination address. |
protected SML_TConnectionListener |
getConnectionListener()
|
void |
setMaxConnections(int maxConnections)
Set the maximum number of connections that are allowed in parallel by the Server SAP. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SML_TSAP()
public SML_TSAP(javax.net.SocketFactory socketFactory)
public SML_TSAP(int port, SML_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 SML_TSAP(int port, SML_TConnectionListener conListener, javax.net.ServerSocketFactory serverSocketFactory)
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.serverSocketFactory
- The ServerSocketFactory to be used to create the ServerSocketMethod Detail |
---|
public void startListening() throws java.io.IOException
java.io.IOException
public void stopListening()
public void setMaxConnections(int maxConnections)
maxConnections
- the number of connections allowed (default is 100)public void setMessageTimeout(int messageTimeout) throws java.net.SocketException
messageTimeout
- in milliseconds
java.net.SocketException
public void setMessageFragmentTimeout(int messageFragmentTimeout) throws java.net.SocketException
messageFragmentTimeout
- in milliseconds
java.net.SocketException
protected SML_TConnectionListener getConnectionListener()
public SML_TConnection connectTo(java.net.InetAddress address, int port) throws java.io.IOException
address
- remote InetAddressport
- remote port
java.io.IOException
- is thrown if connection was unsuccessful.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |