When you connect to a port on loopback that's not open, the operating system immediately sends a TCP RST packet. Connecting to a 192.168 or a 10.* host does not yield the same reset. 

I will look into a mock TCP server that never ACK's. Alternately we could mock out the call to connect() and have the call just sleep, and verify that the connect timeout does what it is supposed to do.

Sample tcpdump traffic on lo0 from a host that's not open (notice the [R.] packet response)

    09:36:15.921174 IP6 (hlim 64, next-header TCP (6) payload length: 44) fe80::1.55621 > fe80::1.avt-profile-2: Flags [S], cksum 0xfd35 (incorrect -> 0x1e2f), seq 533239964, win 65535, options [mss 16324,nop,wscale 4,nop,nop,TS val 643765797 ecr 0,sackOK,eol], length 0
    09:36:15.921191 IP6 (hlim 64, next-header TCP (6) payload length: 20) fe80::1.avt-profile-2 > fe80::1.55621: Flags [R.], cksum 0xfd1d (incorrect -> 0x0d95), seq 0, ack 533239965, win 0, length 0 

Sample tcpdump from a 192.168.* host:

    09:41:33.888484 IP (tos 0x10, ttl 64, id 20873, offset 0, flags [DF], proto TCP (6), length 64)
    kburke.55711 > 192.168.5.6.avt-profile-2: Flags [S], cksum 0xa14e (correct), seq 2132708649, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS val 644083291 ecr 0,sackOK,eol], length 0