public class BasicHttpServer extends Object implements HttpServer
BasicHttpClient| Constructor and Description |
|---|
BasicHttpServer(OutputStream os,
InputStream is)
Constructs a BasicHttpServer that communicates over
an input and output stream.
|
BasicHttpServer(Socket socket)
Constructs a BasicHttpServer that communicates over
a socket.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying input and output streams.
|
OutputStream |
getOutputStream()
Returns a stream for writing data to, if data is to be sent to the
client.
|
ServerRequest |
readRequest()
Reads the HTTP
Request information. |
String |
toString()
Returns debug information.
|
void |
writeResponse(ServerResponse response)
Sends response data to the HTTP client.
|
public BasicHttpServer(Socket socket) throws IOException
IOExceptionpublic BasicHttpServer(OutputStream os, InputStream is)
public ServerRequest readRequest() throws IOException
HttpServerRequest information.readRequest in interface HttpServerIOExceptionpublic void writeResponse(ServerResponse response) throws IOException
HttpServerwriteResponse in interface HttpServerHttpException - if the server returned an invalid HTTP
responseIOExceptionpublic OutputStream getOutputStream()
HttpServergetOutputStream in interface HttpServerpublic void close()
throws IOException
close in interface HttpServerIOExceptionCopyright © 2012. All Rights Reserved.