I have a question and it is What is httpconnection of PoolingHttpClientConnectionManager?.
I know that If we use PoolingHttpClientConnectionManager
, it reduces the time for spending connection establishment (such as ssl handshake
, tcp enter code herehandshake
etc) because it reuses the connections.
However, what I understand about http connection reusing is keep-alive and we can use it when server support it. If host doesn't support keep-alive connection, we cannot communicate with the host with keep-alive.
So, here are my questions,
If I use PoolingHttpClientConnectionManager to manage connections on non keep-alive server environment, does Connectionmanager manage connections? or it creates connection per request?
If ConnectionManager manages connections, how ConnectionManager keep connection? does the manager send bytes periodically?
If you don't define HttpClient will act as connection can be kept alive indefinitely, from Apache http docs:
If you want to define Keep-Alive Strategy see example: