HttpServer
public class DefaultHttpServer extends Object implements HttpServer
Modifier and Type | Field | Description |
---|---|---|
protected ExecutorService |
executorService |
Stores the executor service.
|
protected HttpServerProcessor |
processor |
Stores the processor.
|
protected Thread |
serverAcceptorThread |
Stores the server acceptor thread.
|
protected int |
serverPort |
Stores the port we are listening on.
|
protected ServerSocket |
serverSocket |
Stores the server socket.
|
protected boolean |
serverStopRequest |
Stores the server stop request.
|
protected int |
soTimeout |
Stores the SO_TIMEOUT.
|
protected ThreadFactory |
threadFactory |
Stores the thread factory.
|
Constructor | Description |
---|---|
DefaultHttpServer() |
Constructor
|
DefaultHttpServer(int serverPort,
HttpServerProcessor processor) |
Constructor
|
DefaultHttpServer(int serverPort,
HttpServerProcessor processor,
int soTimeout) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
int |
getSoTimeout() |
Get the SO_TIMEOUT.
|
boolean |
isRunning() |
Is the server running.
|
void |
start() |
Start the server.
|
void |
stop() |
Stop the server.
|
protected ExecutorService executorService
protected HttpServerProcessor processor
protected int serverPort
protected Thread serverAcceptorThread
protected ServerSocket serverSocket
protected boolean serverStopRequest
protected int soTimeout
protected ThreadFactory threadFactory
public DefaultHttpServer()
public DefaultHttpServer(int serverPort, HttpServerProcessor processor)
serverPort
- the server port.processor
- the HTTP server processor.public DefaultHttpServer(int serverPort, HttpServerProcessor processor, int soTimeout)
serverPort
- the server port.processor
- the HTTP server processor.soTimeout
- the SO_TIMEOUT.public int getSoTimeout()
public boolean isRunning()
isRunning
in interface HttpServer
public void start()
start
in interface HttpServer
public void stop()
stop
in interface HttpServer
Copyright © 2020 Piranha Cloud. All rights reserved.