| 程序包 | 说明 |
|---|---|
| esa.httpserver | |
| esa.httpserver.impl |
| 限定符和类型 | 方法和说明 |
|---|---|
static HttpServer |
HttpServer.create()
Creates a new instance of
HttpServer by the default options. |
static HttpServer |
HttpServer.create(ServerOptions options)
Creates a new instance of
HttpServer by the options. |
static HttpServer |
HttpServer.create(String name,
ServerOptions options)
|
HttpServer |
HttpServer.handle(Consumer<RequestHandle> h)
Sets the handler for handing requests received.
|
HttpServer |
HttpServer.listen(int port)
Starts the server which is listening on the given
port. |
HttpServer |
HttpServer.listen(SocketAddress address)
Starts the server which is listening on the given
address. |
HttpServer |
HttpServer.listen(String host,
int port)
Starts the server which is listening on the given
host and port. |
HttpServer |
HttpServer.onClose(Runnable closure)
Adds a close hook which will be called when server is about to closing.
|
HttpServer |
HttpServer.onConnected(Consumer<io.netty.channel.ChannelHandlerContext> h)
Sets the handler for listening connection connected.
|
HttpServer |
HttpServer.onDisconnected(Consumer<io.netty.channel.Channel> h)
Sets the handler for listening connection disconnected.
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
HttpServerImpl |
Copyright © 2020. All rights reserved.