public class HttpServer extends Object implements ModalCloseable
| 构造器和说明 |
|---|
HttpServer(int port,
HttpService httpService,
InetAddress ifAddress,
SocketConfig socketConfig,
ServerSocketFactory serverSocketFactory,
HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory,
Callback<SSLParameters> sslSetupHandler,
ExceptionListener exceptionListener) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
awaitTermination(TimeValue waitTime) |
void |
close() |
void |
close(CloseMode closeMode)
Closes this process or endpoint and releases any system resources associated
with it.
|
void |
close(CloseMode closeMode,
Timeout timeout)
Closes this process or endpoint and releases any system resources associated
with it.
|
InetAddress |
getInetAddress() |
int |
getLocalPort() |
void |
initiateShutdown() |
void |
start() |
void |
stop() |
@Internal public HttpServer(int port, HttpService httpService, InetAddress ifAddress, SocketConfig socketConfig, ServerSocketFactory serverSocketFactory, HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory, Callback<SSLParameters> sslSetupHandler, ExceptionListener exceptionListener)
public InetAddress getInetAddress()
public int getLocalPort()
public void start()
throws IOException
IOExceptionpublic void stop()
public void initiateShutdown()
public void awaitTermination(TimeValue waitTime) throws InterruptedException
public void close(CloseMode closeMode)
ModalCloseableclose 在接口中 ModalCloseablecloseMode - How to close the receiver.public void close(CloseMode closeMode, Timeout timeout)
closeMode - How to close the receiver.timeout - How long to wait for the HttpServer to close gracefully.public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2023. All rights reserved.