connect function serves to establish a connection through a TCP socket
connect([host], port::Integer) -> TCPSocket
only problem is, if the host is not listening through this port, trying to connect will result in an error
julia> connect(5000) ERROR: IOError: connect: connection refused (ECONNREFUSED) Stacktrace:  wait_connected(::TCPSocket) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Sockets\src\Sockets.jl:520  connect at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Sockets\src\Sockets.jl:555 [inlined]  connect at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Sockets\src\Sockets.jl:541 [inlined]  connect(::Int64) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Sockets\src\Sockets.jl:537  top-level scope at REPL:100:
Is there any form to check if the port is available before trying to connect? More specifically, is there a way (appart from a while-try-catch-loop) for the client to wait for the availability of the host? Simmilarly to how
accept(listen(5000)) waits for a client to connect.