public class HttpEndpoint extends Object implements Endpoint
Endpoint.EndpointType, Endpoint.Protocol| Modifier and Type | Field and Description |
|---|---|
protected int |
_acceptQueueSize |
protected String |
_host |
protected int |
_maxIdleTime |
protected int |
_numAcceptors |
protected int |
_port |
protected Endpoint.Protocol |
_protocol |
protected Endpoint.EndpointType |
_type |
| Constructor and Description |
|---|
HttpEndpoint(int port)
Construct an HTTP endpoint that listens on all interfaces.
|
HttpEndpoint(String host,
int port)
Construct an HTTP endpoint for a particular host and port.
|
HttpEndpoint(String host,
int port,
Endpoint.Protocol protocol)
Construct an HTTP endpoint for a particular host, port, and protocol.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAcceptQueueSize()
Get number of connection requests that can be queued up before the
operating system starts to send rejections.
|
Endpoint.EndpointType |
getEndpointType()
Get the endpoint connector I/O type.
|
String |
getHost()
Returns the endpoint's host.
|
int |
getMaxIdleTime()
Default valule is 200000 ms
|
int |
getNumAcceptors()
Get the number of thread dedicated to accepting incoming connections.
|
int |
getPort()
Returns the endpoint's port number.
|
Endpoint.Protocol |
getProtocol()
Returns the endpoint's protocol.
|
void |
setAcceptQueueSize(int acceptQueueSize)
Set number of connection requests that can be queued up before the
operating system starts to send rejections.
|
void |
setEndpointType(Endpoint.EndpointType type)
Set the endpoint connector I/O type (like blocking or NIO).
|
void |
setMaxIdleTime(int maxIdleTime)
Set the maximum Idle time for a connection, which roughly translates
to the
Socket.setSoTimeout(int) call but depends on
the application server used and how it is configured. |
void |
setNumAcceptors(int acceptors)
Set the number of thread dedicated to accepting incoming connections.
|
String |
toString() |
protected String _host
protected int _port
protected Endpoint.Protocol _protocol
protected int _numAcceptors
protected int _acceptQueueSize
protected int _maxIdleTime
protected Endpoint.EndpointType _type
public HttpEndpoint(String host, int port, Endpoint.Protocol protocol)
host - The listening interface.port - The listening port.protocol - The listening protocol.public HttpEndpoint(int port)
port - The listening port.public HttpEndpoint(String host, int port)
host - The listening interface.port - The listening port.public int getPort()
Endpointpublic String getHost()
Endpointpublic Endpoint.Protocol getProtocol()
EndpointgetProtocol in interface Endpointpublic int getAcceptQueueSize()
EndpointgetAcceptQueueSize in interface Endpointpublic int getNumAcceptors()
EndpointgetNumAcceptors in interface Endpointpublic void setAcceptQueueSize(int acceptQueueSize)
EndpointsetAcceptQueueSize in interface EndpointacceptQueueSize - max number of queued requests. Defaults to 0. For the semantics
see backlog parameter in
ServerSocket.bind(java.net.SocketAddress, int)public void setNumAcceptors(int acceptors)
EndpointsetNumAcceptors in interface Endpointacceptors - thread number. Defaults to 1public int getMaxIdleTime()
EndpointgetMaxIdleTime in interface Endpointpublic void setMaxIdleTime(int maxIdleTime)
EndpointSocket.setSoTimeout(int) call but depends on
the application server used and how it is configured.
The max idle time is applied:This value MUST be bigger than the keep alive period on the client.
Default value is 200000 ms
setMaxIdleTime in interface EndpointmaxIdleTime - The maxIdleTime to set.public Endpoint.EndpointType getEndpointType()
EndpointgetEndpointType in interface EndpointEndpointType representing the typepublic void setEndpointType(Endpoint.EndpointType type)
EndpointEndpoint.EndpointType.BLOCKING.setEndpointType in interface Endpointtype - the I/O type to useCopyright © 2022. All rights reserved.