In Apache's httpclient package, there are three settings where the setting expires:
(1)/* Timeout for the connection from the socket connection pool */[Socket connection pool]
Connmanagerparams.settimeout (params, 1000);
Set Connectionpooltimeout:
This defines the timeout for removing the connection from the ConnectionManager managed connection pool, set here to 1 seconds.
(2)/* Connection timeout time for socket connection to server */
Httpconnectionparams.setconnectiontimeout (params, 2000);
Set ConnectionTimeout:
This defines the time-out for establishing a socket connection to the server over a network. HttpClient package to create a socket connection to the server, which is the time-out of the socket connection, set here to 2 seconds.
(3)/*socket timeout time to read data */"Response timeout"
Httpconnectionparams.setsotimeout (params, 4000);
Set Sockettimeout
This defines the time-out for the socket read data, that is, how long it will take for the response data to be fetched from the server, set here to 4 seconds.
Each of the above 3 timeouts will throw connectionpooltimeoutexception,
Connectiontimeoutexception
Sockettimeoutexception.