-
Notifications
You must be signed in to change notification settings - Fork 2
TCP UDP
dm03514 edited this page Aug 30, 2018
·
3 revisions
$ ./bin/wait-for net --help
NAME:
wait-for net -
USAGE:
wait-for net [command options] [arguments...]
OPTIONS:
--network value, -n value Protocol: ("tcp", "udp"), any value that go net.Dial accepts (default: "tcp")
--address value, -a value address and port ie localhost:8000
# postgres LISTENing on port 5432
$ ./bin/wait-for -t 1s -pi 250ms net -n tcp -a localhost:5432
{"level":"info","msg":"polling","time":"2018-08-30T02:04:45Z"}
{"error":null,"level":"debug","local_addr":{"IP":"127.0.0.1","Port":56850,"Zone":""},"module":"poller.Net","msg":"conn_response","remote_addr":{"IP":"127.0.0.1","Port":5432,"Zone":""},"time":"2018-08-30T02:04:45Z"}
{"err":null,"level":"debug","msg":"poll_result","ready":true,"time":"2018-08-30T02:04:45Z"}
$ echo $?
0
$ ./bin/wait-for -t 1s -pi 250ms net -n tcp -a localhost:4444
{"level":"info","msg":"polling","time":"2018-08-30T02:03:10Z"}
{"err":"dial tcp 127.0.0.1:4444: connect: connection refused","level":"debug","msg":"poll_result","ready":false,"time":"2018-08-30T02:03:10Z"}
{"level":"info","msg":"polling","time":"2018-08-30T02:03:10Z"}
{"err":"dial tcp 127.0.0.1:4444: connect: connection refused","level":"debug","msg":"poll_result","ready":false,"time":"2018-08-30T02:03:10Z"}
{"level":"info","msg":"polling","time":"2018-08-30T02:03:11Z"}
{"err":"dial tcp 127.0.0.1:4444: connect: connection refused","level":"debug","msg":"poll_result","ready":false,"time":"2018-08-30T02:03:11Z"}
{"level":"info","msg":"polling","time":"2018-08-30T02:03:11Z"}
{"err":"dial tcp 127.0.0.1:4444: connect: connection refused","level":"debug","msg":"poll_result","ready":false,"time":"2018-08-30T02:03:11Z"}
{"level":"info","msg":"polling","time":"2018-08-30T02:03:11Z"}
{"err":"dial tcp 127.0.0.1:4444: connect: connection refused","level":"debug","msg":"poll_result","ready":false,"time":"2018-08-30T02:03:11Z"}
{"level":"info","msg":"timeout_reached","time":"2018-08-30T02:03:11Z"}
{"level":"fatal","msg":"timeout reached: 1s","time":"2018-08-30T02:03:11Z"}
$ echo $?
1