Board index » cppbuilder » passive mode

passive mode


2005-09-28 04:01:07 PM
cppbuilder96
Hi,
I'am using indy9 ftp server.
I want to use passive mode.
Does anyone know what the eventhandler
for PASV would look like ?
Kind regards
Jonny
 
 

Re:passive mode

"Jonny" < XXXX@XXXXX.COM >wrote in message
Quote
I'am using indy9 ftp server.
I want to use passive mode.
Does anyone know what the eventhandler
for PASV would look like ?
Indy 9 TIdFTPServer already supports PASV. You do not need to implement it
yourself. If you are trying to customize the IP/port that is sent to the
client, instead of using the default values that TIdFTPServer automatically
calculates, then you can use the OnPASV event for that, ie:
procedure TForm1.IdFTPServer1Pasv(ASender: TIdFTPServerThread; var VIP :
String; var VPort : Word);
begin
VIP := 'Whatever IP address the client should connect to';
VPort := WhateverPortNumberTheClientShouldConnectTo;
end;
About the only time you would ever want to customize the IP/port manually is
if your server machine is running being a router with port forwarding
enabled, since the client will connect to the router directly instead of the
server and thus needs to know the router's IP/port instead of the server's.
Gambit
 

Re:passive mode

Thank's a lot
Jonny
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >skrev i meddelandet
Quote

"Jonny" < XXXX@XXXXX.COM >wrote in message
news:433a4d21$ XXXX@XXXXX.COM ...

>I'am using indy9 ftp server.
>I want to use passive mode.
>Does anyone know what the eventhandler
>for PASV would look like ?

Indy 9 TIdFTPServer already supports PASV. You do not need to implement
it
yourself. If you are trying to customize the IP/port that is sent to the
client, instead of using the default values that TIdFTPServer
automatically
calculates, then you can use the OnPASV event for that, ie:

procedure TForm1.IdFTPServer1Pasv(ASender: TIdFTPServerThread; var VIP
:
String; var VPort : Word);
begin
VIP := 'Whatever IP address the client should connect to';
VPort := WhateverPortNumberTheClientShouldConnectTo;
end;

About the only time you would ever want to customize the IP/port manually
is
if your server machine is running being a router with port forwarding
enabled, since the client will connect to the router directly instead of
the
server and thus needs to know the router's IP/port instead of the
server's.


Gambit


 

{smallsort}