java.lang.Object
de.grogra.http.Server
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
APIServer,HttpServer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServer(ServerSocket socket, Logger logger, Level infoLevel, Level warningLevel) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()protected abstract booleanhandleRequest(Request request, Socket client) booleanisClosed()voidrun()static voidwriteResponse(int code, String reason, String mimeType, byte[] content, boolean closeConnection, OutputStream os)
-
Field Details
-
CONTENT_LENGTH
- See Also:
-
CONTENT_TYPE
- See Also:
-
CRLF
- See Also:
-
-
Constructor Details
-
Server
-
-
Method Details
-
getLogger
-
getInfoLevel
-
getWarningLevel
-
run
public void run() -
accept
-
writeResponse
public static void writeResponse(int code, String reason, String mimeType, byte[] content, boolean closeConnection, OutputStream os) throws IOException - Throws:
IOException
-
isClosed
public boolean isClosed() -
close
- Throws:
IOException
-
handleRequest
- Throws:
IOException
-