use ttl to check http and socket timeout