java.lang.Object
de.grogra.http.Server
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
APIServer
,HttpServer
-
Field Summary
-
Constructor Summary
ConstructorDescriptionServer
(ServerSocket socket, Logger logger, Level infoLevel, Level warningLevel) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
protected abstract boolean
handleRequest
(Request request, Socket client) boolean
isClosed()
void
run()
static void
writeResponse
(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
-