Board index » delphi » Server running a server

Server running a server

I've just built a nice Authentication server using a TIdTCPServer as a base.
I'm ready to build a authenticated TFTP server, by first having the
Authentication server login the user, when logged in, I run (in server)
OnAuthenticated.
There I create a context (including the TIdTFTPServer), and assign the
correct code to the different functions.

Problem:
I've got this small bit of code:
TUserContext = class
  Server : TIdTFTPServer;
  ... blablabla

procedure TForm1.OnUserAuth(Sender: TObject);
var Running : Boolean;
begin
  with TUserContext.Create do
  try
    try
      Server.Active := True;
      Running := True;
    except
      Running := False;
    end;
    if Running then begin
      with (Sender as TIdPeerThread) do begin
        Connection.WriteLn('+OK ' + IntToStr(Server.Bindings[0].Port));
      end;
    end;
  finally
    Free;
  end;
end;

Now I want to keep the TCP connection (with the Authentication server) up
while it is doing it's work with the TFTPServer.
But it also must connect in a certain timeframe.
How can I accomplish this?

Thanx,
Rory

 

Re:Server running a server


If you are writing the client, you can control the timnig of the log in to
the FTP server... couldn't you?
To be really tricky, you could send an encrypted challenge code on the TCP
connection that would be entered as the username/password on the FTP server
and change it every X seconds.

When the client disconnects from TCP, you can drop the FTP.

Quote
"DJ Bo" <d...@gios.nl> wrote in message

news:3d6207f0@newsgroups.borland.com...
Quote
> Now I want to keep the TCP connection (with the Authentication server) up
> while it is doing it's work with the TFTPServer.
> But it also must connect in a certain timeframe.
> How can I accomplish this?

Other Threads