Convert port to integer before use

Uses `binary_to_integer` to convert port to integer.