public class SingleThreadHttpServer extends Object implements cloud.piranha.api.HttpServer, Runnable
| Modifier and Type | Field and Description |
|---|---|
protected cloud.piranha.api.HttpServerProcessor |
processor
Stores the processor.
|
protected boolean |
running
Stores the running flag.
|
protected int |
serverPort
Stores the port we are listening on.
|
protected Thread |
serverProcessingThread
Stores the server acceptor thread.
|
protected ServerSocket |
serverSocket
Stores the server socket.
|
protected boolean |
serverStopRequest
Stores the server stop request.
|
protected int |
soTimeout
Stores the SO_TIMEOUT.
|
| Constructor and Description |
|---|
SingleThreadHttpServer()
Constructor
|
SingleThreadHttpServer(int serverPort,
cloud.piranha.api.HttpServerProcessor processor)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isRunning()
Is the server running.
|
void |
run()
Handle the socket request.
|
void |
start()
Start the server.
|
void |
stop()
Stop the server.
|
protected cloud.piranha.api.HttpServerProcessor processor
protected boolean running
protected Thread serverProcessingThread
protected int serverPort
protected ServerSocket serverSocket
protected boolean serverStopRequest
protected int soTimeout
public SingleThreadHttpServer()
public SingleThreadHttpServer(int serverPort,
cloud.piranha.api.HttpServerProcessor processor)
serverPort - the server port.processor - the HTTP server processor.public boolean isRunning()
isRunning in interface cloud.piranha.api.HttpServerpublic void start()
start in interface cloud.piranha.api.HttpServerpublic void stop()
stop in interface cloud.piranha.api.HttpServerCopyright © 2020. All rights reserved.