How to create an efficient port scanner