FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
482 stars 163 forks source link

Port 0 is not allowed #55

Closed twodogmbh closed 5 years ago

twodogmbh commented 5 years ago

The MultiBindingTcpListener does not allow 0 as port parameter in the constructor. But port 0 is a valid parameter of the TcpListener class. "Specify Any for the local IP address and 0 for the local port number if you want the underlying service provider to assign those values for you. "

Scenario: In integration tests we want to start multiple FTP servers in parallel without specifying the port number. Once the FTP server is started the assigned port is read and used in the corresponding FTP clients.

fubar-coder commented 5 years ago

Fixed in v3.0.0-beta.3.

twodogmbh commented 5 years ago

With the fix in v3.0.0-beta.3, the FTP server can start with an arbitrary port when passing port 0. But there is no way to get the actual used port back.

It would be helpful if the IFtpServer.Port property would be updated once the MultiBindingTcpListener knows which port it is going to use.

fubar-coder commented 5 years ago

Will be fixed in 3.0.0-rc.4 or 3.0.0 (whatever comes first).