In the command below I enable the file /dev/tcp/10.10.10.1/80 both for reading and writing and associate it with file descriptor 3:
This automatically tries to perform a TCP three-way handshake. If 10.10.10.1 is not reachable as in the example above, then the connect system call tries to connect for 75 seconds. Is there a way to decrease this value in FreeBSD 8.0 so it times out, for example after 3 seconds? Or is it even possible to decrease the value of the connect() system call in bash itself?
Code:
$ time exec 3<>/dev/tcp/10.10.10.1/80
bash: connect: Operation timed out
bash: /dev/tcp/10.10.10.1/80: Operation timed out
real 1m15.151s
user 0m0.000s
sys 0m0.000s
$
This automatically tries to perform a TCP three-way handshake. If 10.10.10.1 is not reachable as in the example above, then the connect system call tries to connect for 75 seconds. Is there a way to decrease this value in FreeBSD 8.0 so it times out, for example after 3 seconds? Or is it even possible to decrease the value of the connect() system call in bash itself?