Package jmri.jmris
Class JmriServer
- java.lang.Object
-
- jmri.jmris.JmriServer
-
- Direct Known Subclasses:
JmriSRCPServer
,JsonServer
,SimpleServer
public class JmriServer extends java.lang.Object
This is the main JMRI Server implementation. It starts a thread for each client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JmriServer.ClientListener
(package private) class
JmriServer.NewClientListener
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<JmriServer.ClientListener>
connectedClientThreads
protected java.net.ServerSocket
connectSocket
protected int
portNo
protected ZeroConfService
service
protected ShutDownTask
shutDownTask
protected int
timeout
-
Constructor Summary
Constructors Constructor Description JmriServer()
JmriServer(int port)
JmriServer(int port, int timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
advertise()
protected void
advertise(java.lang.String type)
protected void
advertise(java.lang.String type, java.util.HashMap<java.lang.String,java.lang.String> properties)
void
handleClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream)
void
start()
void
stop()
void
stopClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream)
-
-
-
Field Detail
-
portNo
protected int portNo
-
timeout
protected int timeout
-
connectSocket
protected java.net.ServerSocket connectSocket
-
service
protected ZeroConfService service
-
shutDownTask
protected ShutDownTask shutDownTask
-
connectedClientThreads
protected java.util.ArrayList<JmriServer.ClientListener> connectedClientThreads
-
-
Constructor Detail
-
JmriServer
public JmriServer()
-
JmriServer
public JmriServer(int port)
-
JmriServer
public JmriServer(int port, int timeout)
-
-
Method Detail
-
start
public void start()
-
advertise
protected void advertise()
-
advertise
protected void advertise(java.lang.String type)
-
advertise
protected void advertise(java.lang.String type, java.util.HashMap<java.lang.String,java.lang.String> properties)
-
stop
public void stop()
-
handleClient
public void handleClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream) throws java.io.IOException
- Throws:
java.io.IOException
-
stopClient
public void stopClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-