convert string ports to integers