suggestion for FTP

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Tsunulukai
Junior Member
Junior Member
Posts: 66
Joined: 2003-02-07, 23:44 UTC

suggestion for FTP

Post by *Tsunulukai »

For user behind firewalls, corporate as well as private, a great option would be to be able to set a port range for local connections, as in FlashFXP "Limit local port range to [xxx - xxx]"

I know one possibility is to set the connection in Passive mode, but it's not what I mean, cuz then FXP transfert are unavailable (if both connections are in passive mode...)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Good idea! However, does anyone know how to do this? Currently TC just requests a random port from Windows, and Windows itself determines which port to use. Any idea how to request a random port within a range?
Author of Total Commander
https://www.ghisler.com
Tsunulukai
Junior Member
Junior Member
Posts: 66
Joined: 2003-02-07, 23:44 UTC

Post by *Tsunulukai »

Can't you choose a port by yourself, instead of getting it from Windows ? That way you wouldn't have to request a port from within a range as TCmd itself would choose it...
How do the server apps run on a specified port if they can't choose it by themselves ? I suppose this is possible for Tcmd... at least I hope so :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes I can, but the port may already be in use - or may be in a term-wait state, which means that it can be opened, but connections will not work...
Author of Total Commander
https://www.ghisler.com
Tsunulukai
Junior Member
Junior Member
Posts: 66
Joined: 2003-02-07, 23:44 UTC

Post by *Tsunulukai »

and... is there no way for Tcmd to get the state of a specified port before using it ?
A way to get the results of a "netstat -an" and prevent Tcmd from using anyone that the command returned ?

I don't know... I'm not programmer but I guess there should be a possibility (as FlashFXP does it...)

Any programmer out of there who's got an idea ? :)
User avatar
jofer
Junior Member
Junior Member
Posts: 10
Joined: 2003-02-06, 16:02 UTC
Location: Mainspitze, D

Post by *jofer »

>Can't you choose a port by yourself, instead of getting it from Windows ?
>>However, does anyone know how to do this?

This thread may help:
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_10332325.html

EntryFrom - EntryTo
if empty -> random

BTW
How about an extra-check "Use plugin" i.e. SFTP plugin ;-)

HTH
Jochen
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2jofer
Unfortunately the code presented there doesn't help - as some users have pointed out, as soon as a connection is made, the server can again listen on the same port - which is normally a bad idea with FTP. Perhaps I should just increment the port after using it, and check if noone is listening?
Author of Total Commander
https://www.ghisler.com
Post Reply