Virtual Private Network

I am writing a communication software and I want to be able to transfer data (probably text files) over a VPN. Any ideas or possible better solutions.
I am very generous with points, I'm looking for something that is more or less bug proof and secure. I have a total of 720pts avalible for this question depending on speed and value.
rpmcdonaldAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rbohacCommented:
Have you tried a simple FTP server? Is it to slow?

You could also use the Indy (IDTCPClient/IDTCPServer) components to write a client and a server application.

Example:

procedure TForm1.Button1Click(Sender: TObject);
var
  FileStream : TFileStream;
begin
  {Client Side}
  FileStream := TFileStream.Create('c:\MyFile.txt',fmOpenRead);
  try
    IdTCPClient1.Host := 'Whatever';
    IdTCPClient1.Port := 12345;
    IdTCPClient1.Connect;
    IdTCPClient1.WriteStream(FileStream,True,True);
    IdTCPClient1.Disconnect
  Finally
    FileStream.Free;
  end;

end;

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
  FileStream : TFileStream;
begin
  {Server Side}
  FileStream := TFileStream.Create('c:\myfilenew.txt',fmOpenWrite);
  try
    AThread.Connection.ReadStream(FileStream);
  finally
    FileStream.Free;
  end;
  AThread.Terminate;
end;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rbohacCommented:
Actually it should be fmCreate not fmOpenWrite
0
rpmcdonaldAuthor Commented:
Would both server and client need to manually activated or would the server automatically know when a transmission was sent...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rbohacCommented:
IDTCPServer has an active property. This would need to be set to true before it would accept connections. After that it would automatically accept (and multithread) new connections
0
rpmcdonaldAuthor Commented:
Sounds Great!! I wont be able to test it for a while, but thanks for the help
0
rbohacCommented:
Sure. Followup if you have any more questions about it.

Also, you can pass the filename with a few small changes:
procedure TForm1.Button1Click(Sender: TObject);
var
  FileStream : TFileStream;
  FileName   : String;
begin
  {Client Side}
  FileName   := 'c:\myfile.txt';
  FileStream := TFileStream.Create(FileName,fmOpenRead);
  try
    IdTCPClient1.Host := 'localhost';
    IdTCPClient1.Port := 12345;
    IdTCPClient1.Connect;
    IdTCPClient1.WriteLn(ExtractFileName(FileName));
    IdTCPClient1.WriteStream(FileStream,True,True);
    IdTCPClient1.Disconnect
  Finally
    FileStream.Free;
  end;

end;

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
  FileStream   : TFileStream;
  BaseFilePath : String;
begin
  {Server Side}
  BaseFilePath := 'c:\';
  FileName     := AThread.Connection.ReadLn;
  FileStream   := TFileStream.Create(BaseFilePath + FileName,fmCreate);
  try
    AThread.Connection.ReadStream(FileStream);
  finally
    FileStream.Free;
  end;
  AThread.Terminate;
end;
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.