FTP client issues PASV command and FTP server responds with “227 Entering Passive Mode (213,229,112,130,216,4)”. 213,229,112,130 is IP address. 216 is upper 8bits in decimal. 4 is lower 8bits in decimal. So port number is 216 * 256 + 4. You should parse them in bracket.
References: