wait_for module related

I was wondering how does wait_for figures out if a port is listening on remote machine. Does it use port scanners like nmap or netcat or simply makes a telnet connection on that port?

It will try to open a socket.


s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(connect_timeout)
try:
s.connect( (host, port) )