Package jmri.server.json
Class JsonServer
- java.lang.Object
-
- jmri.jmris.JmriServer
-
- jmri.server.json.JsonServer
-
- All Implemented Interfaces:
InstanceManagerAutoDefault
public class JsonServer extends JmriServer implements InstanceManagerAutoDefault
This is an implementation of a JSON server for JMRI. Seejmri.server.json
for more details.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmris.JmriServer
JmriServer.ClientListener
-
-
Field Summary
-
Fields inherited from class jmri.jmris.JmriServer
connectedClientThreads, connectSocket, portNo, service, shutDownTask, timeout
-
-
Constructor Summary
Constructors Constructor Description JsonServer()
Create a new server using the default port.JsonServer(int port, int timeout)
Create a new server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
advertise()
void
handleClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream)
void
start()
void
stop()
void
stopClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream)
-
Methods inherited from class jmri.jmris.JmriServer
advertise, advertise
-
-
-
-
Constructor Detail
-
JsonServer
public JsonServer()
Create a new server using the default port.
-
JsonServer
public JsonServer(int port, int timeout)
Create a new server.- Parameters:
port
- the port to listen ontimeout
- the timeout before closing unresponsive connections
-
-
Method Detail
-
start
public void start()
- Overrides:
start
in classJmriServer
-
stop
public void stop()
- Overrides:
stop
in classJmriServer
-
advertise
protected void advertise()
- Overrides:
advertise
in classJmriServer
-
handleClient
public void handleClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream) throws java.io.IOException
- Overrides:
handleClient
in classJmriServer
- Throws:
java.io.IOException
-
stopClient
public void stopClient(java.io.DataInputStream inStream, java.io.DataOutputStream outStream) throws java.io.IOException
- Overrides:
stopClient
in classJmriServer
- Throws:
java.io.IOException
-
-