gbarr/perl-libnet — pull request #7 by rimantas-cernauskas (2013-10-01 12:54:52+00:00)
Title: Set static local client port for FTP "active" mode connections

Our application is behind the firewall and one of our providers insisted of having "active" FTP connection for files upload. Due to security reasons, operations requested to use static port for incoming data connection from FTP server( which is usually supported by sending PORT command to FTP server ), however Net::FTP was not creating socket if you would issue $ftp->port("xxx,xxx,xxx,xxx,aa,bb") command.
This change introduces method set_local_port($IntPortNumber) for exactly this purpose( It's also being called by constructor if LocalPort is specified, so it can be used by wrappers like Net::FTP::AutoReconnect).
Bear in mind, that value for set_local_port is decimal port number to be used in IO::Socket.
Reuse option will be automatically set for IO::Socket constructor.

Any comments or suggestions are very welcome.