Added methods to parse port and IP.