added timeout callback function on request

as we don’t want to keep sending requests when we don’t get a response.
Now we only send a request in 2 situations. 15 seconds after we receive
a response or 15 seconds our request times out.
we also read the ‘timeout’ from the JSON configuration file.
As we can’t now beforehand when will be out next request, the
‘setInterval()’ function has been replace for ‘setTimeout()’. We also
always keep track of the setTimeout identifier (a call to setTimeout,
returns an identifier for the function called by it).
we also consider a request’s timeout as a bad situation. so we don’t do
anything more than scheduling the next request when the timeout happens.