Use more strict conversion of port number

We're using CInt for converting the port number. It's not very strict. It
will for example parse doubles by converting them to integers, which we
should not really accept. We should instead use Integer.Parse which will
throw an exception in that case.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>