gomap
gomap copied to clipboard
Distinguish between open/refused/timeout
In my local copy I've made modifications so that the portResult distinguishes between these three cases: Connect OK - LISTEN process on the other end made a connection Timeout - Firewall blocked connection Connection Refused - Firewall did not block connection, but no LISTENing process on the other end. Thus this port could be used for a new server process
I find this handy because I don't want to have to open new ports in the firewall, and so I need to see what ports are open without having to run a listening process on all ports.
Send over a PR, and i'll give this new feature a test.
Not happy with my current implementation. Need to do some more research/experimentation.
Go does not make it easy to distinguish the reasons that a Dial
fails, unlike ECONNREFUSED in C.