Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection and connection request timeout

I am using Http Apache Components to perform the http interactions. I need to adjust my http client. For this purpose I have two parameters: connection timeout and connection request timeout. In library documentation and in source code(no comments were found) I didn't found definition of this terms. I need to know what do they exactly mean. May be they were defined in HTTP protocol documentation but I can't find it. So, my question is what do this two terms mean and how they distinct from each other.

like image 790
mvb13 Avatar asked Nov 28 '13 16:11

mvb13


People also ask

What does it mean when a connection timeout?

Connection timeout is on the client's side, usually meaning that the client lost connection, or is unable to establish connection to a server for whatever reason (such as remote firewall is dropping the traffic or the server went down).

What causes connection timeout?

Server timeout and error messages occur when a program attempts to connect to a non-existent server, either because it is down or because the IP is incorrect. As a result, your browser requests information that the server does not have.


1 Answers

HttpClient has a way to set connection and socket timeout (setConnectionTimeout() and setTimeout()) according to the HttpClient javadocs.

Connection timeout is the timeout until a connection with the server is established.

Socket timeout is the timeout to receive data (socket timeout).

Example:

Let's say you point your browser to access a web page. If the server does not anwser in X seconds, a connection timeout will occur. But if it establishes the connection, then the server will start to process the result for the browser. If it does not ends this processing in Y seconds, a socket timeout will occur.

like image 164
dgimenes Avatar answered Oct 14 '22 13:10

dgimenes