Package jmri.jmrix.bidib.tcpserver
Class TcpServer
- java.lang.Object
-
- jmri.jmrix.bidib.tcpserver.TcpServer
-
public class TcpServer extends java.lang.Object
JMRI Implementation of the BiDiBOverTcp Server Protocol. Starting and Stopping of the server is delegated to the NetPlainTcpBidib class. There is one server for each BiDiB connection and they must have different port numbers, so the client is connected to a specific BiDiB connection.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
AUTO_START_KEY
(package private) NetPlainTcpBidib
netPlainTcpBidib
(package private) static java.lang.String
PORT_NUMBER_KEY
(package private) java.util.ResourceBundle
rb
(package private) java.net.ServerSocket
serverSocket
(package private) ZeroConfService
service
(package private) static java.lang.String
SETTINGS_FILE_NAME
(package private) boolean
settingsChanged
(package private) boolean
settingsLoaded
(package private) java.lang.Runnable
shutDownTask
-
Constructor Summary
Constructors Constructor Description TcpServer(BiDiBSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disable()
void
enable()
boolean
getAutoStart()
int
getPortNumber()
BiDiBSystemConnectionMemo
getSystemConnectionMemo()
Get access to the system connection memo associated with this traffic controller.boolean
isEnabled()
boolean
isSettingChanged()
void
saveSettings()
void
setAutoStart(boolean start)
void
setPortNumber(int port)
void
updateClientStateListener()
void
updateServerStateListener()
-
-
-
Field Detail
-
rb
final java.util.ResourceBundle rb
-
netPlainTcpBidib
NetPlainTcpBidib netPlainTcpBidib
-
serverSocket
java.net.ServerSocket serverSocket
-
settingsLoaded
boolean settingsLoaded
-
settingsChanged
boolean settingsChanged
-
shutDownTask
java.lang.Runnable shutDownTask
-
service
ZeroConfService service
-
AUTO_START_KEY
static final java.lang.String AUTO_START_KEY
- See Also:
- Constant Field Values
-
PORT_NUMBER_KEY
static final java.lang.String PORT_NUMBER_KEY
- See Also:
- Constant Field Values
-
SETTINGS_FILE_NAME
static final java.lang.String SETTINGS_FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TcpServer
public TcpServer(BiDiBSystemConnectionMemo memo)
-
-
Method Detail
-
saveSettings
public void saveSettings()
-
getAutoStart
public boolean getAutoStart()
-
setAutoStart
public void setAutoStart(boolean start)
-
getPortNumber
public int getPortNumber()
-
setPortNumber
public void setPortNumber(int port)
-
isEnabled
public boolean isEnabled()
-
isSettingChanged
public boolean isSettingChanged()
-
enable
public void enable()
-
disable
public void disable()
-
updateServerStateListener
public void updateServerStateListener()
-
updateClientStateListener
public void updateClientStateListener()
-
getSystemConnectionMemo
public BiDiBSystemConnectionMemo getSystemConnectionMemo()
Get access to the system connection memo associated with this traffic controller.- Returns:
- associated systemConnectionMemo object
-
-