same error as eof i'd say .. On Fri, Apr 11, 2025, 01:53 A. James Lewis <ja...@fsck.co.uk> wrote:
> I'm not quite sure about that, I would be trying to get back the file > descriptor to use for a period and then close it... so if it fails to > open, then I don't know if "redirection error" makes sense, but then > again, I'm not sure what would the correct error be. > > Certainly I would just be checking for a successful exit code from > opening the connection.... > > It makes me wonder what the existing error message is, because it > /does/ time out currently... but only after 10 minutes, which I think > is the kernel giving up, and thus forcing the failure. > > My use case for reference, is trying to connect to a primary server, > but waiting only 2-5 seconds before giving up and trying a secondary... > as my goal is to achieve a connection as quickly as possible, but > ideally waiting not waiting any longer than 5 seconds if the primary > server is down and I must move on to the secondary. > > James > > > On Thu, 2025-04-10 at 15:14 -0400, Chet Ramey wrote: > > On 4/7/25 6:24 PM, A. James Lewis wrote: > > > I've not been around this mailing list all too long, so I don't > > > know if > > > this has been debated before, but I have always attempted to avoid > > > using external programs where functionality within bash can meet a > > > requirement. Doing this allows my scripts to be more reliable, and > > > not > > > depend on those external tools being installed... > > > > > > I have however found it extremely frustrating to open TCP > > > connections > > > via /dev/tcp, because there appears to be no way to control the > > > timeout! This means I cannot "try one server and move on to the > > > next > > > if it's not responding" etc... the default timeout is quite long, > > > so > > > even a simple script to check a list of servers for a response on a > > > given port is problematic. > > > > > > Is this a feature which might be possible in a future version of > > > Bash? > > > > I'll look at it for a future version. One question: do you think a > > connection timeout should be considered a redirection error? > > > > -- > > ``The lyf so short, the craft so long to lerne.'' - Chaucer > > ``Ars longa, vita brevis'' - Hippocrates > > Chet Ramey, UTech, CWRU c...@case.edu > > http://tiswww.cwru.edu/~chet/ > >