Class ServerInstance
java.lang.Object
net.uiqui.embedhttp.server.ServerInstance
- All Implemented Interfaces:
HttpServer
-
Field Summary
FieldsFields inherited from interface net.uiqui.embedhttp.HttpServer
DEFAULT_BACKLOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintRetrieves the port on which the server is running.booleanChecks if the server is currently running.booleanStarts the HTTP server with the specified router.booleanstop()Stops the HTTP server.
-
Field Details
-
SO_TIMEOUT
public static final int SO_TIMEOUT- See Also:
-
-
Constructor Details
-
ServerInstance
public ServerInstance(int port, int backlog)
-
-
Method Details
-
start
Description copied from interface:HttpServerStarts the HTTP server with the specified router.- Specified by:
startin interfaceHttpServer- Parameters:
router- The router to handle incoming requests.- Returns:
- true if the server started successfully, false otherwise.
- Throws:
InterruptedException- If an error occurs while starting the server.
-
stop
Description copied from interface:HttpServerStops the HTTP server.- Specified by:
stopin interfaceHttpServer- Returns:
- true if the server stopped successfully, false otherwise.
- Throws:
InterruptedException- If an error occurs while stopping the server.
-
isRunning
public boolean isRunning()Description copied from interface:HttpServerChecks if the server is currently running.- Specified by:
isRunningin interfaceHttpServer- Returns:
- true if the server is running, false otherwise.
-
getInstancePort
public int getInstancePort()Description copied from interface:HttpServerRetrieves the port on which the server is running.- Specified by:
getInstancePortin interfaceHttpServer- Returns:
- The port number.
-