Port scanning code