login about faq

Hello!

I made a simple console application for port forwarding like plink. When i made 410 ports forwardings (run 410 copies of application) , everything is fine, CPU Load 0%. But when i made 450 ports forwardings, CPU Load is 100%. Each console application starts consuming 1-2% of the processor time. All port forwardings is working. Why is this happened?

program stineconnect;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,Chilkat_v9_5_0_TLB,classes;

  var

success: Integer;
tunnel: TChilkatSshTunnel;
sshHostname: PWideChar;
sshPort: Integer;
waitForThreadExit: integer;
info:tstringlist;
cmd:string;
port,user,ip:string;

begin

if paramstr(1)<>'' then
begin
  info:=tstringlist.create;
  info.Delimiter:='@';
  info.DelimitedText:=paramstr(2);
  user:=info[0];
  ip:=info[1];
  info.Clear;
  info.Delimiter:=':';
  info.DelimitedText:=paramstr(8);
  port:=info[1];
  info.Free;

tunnel := TChilkatSshTunnel.Create(nil);
tunnel.UnlockComponent('Anything for 30-day trial.') ;

sshHostname := pchar(ip);
sshPort := strtoint(paramstr(4));

  success :=tunnel.Connect(sshHostname,sshPort);

if (success <> 1) then
  begin
   Exit;
  end;

  success := tunnel.AuthenticatePw(pchar(user),pchar(paramstr(6)));
if (success <> 1) then
  begin

    Exit;
  end;
  tunnel.DynamicPortForwarding:=1;
 success := tunnel.BeginAccepting(strtoint(port));
if (success <> 1) then
  begin
    Exit;
  end;

   ReadLn(cmd);
end;
end.

asked Jun 03 at 09:11

Striker's gravatar image

Striker
1


I tried to redirect ports using OpenDirectTcpIpChannel (TChilkatSsh and TChilkatSshTunnel), and through DynamicPortForwarding. Everywhere the same problem, up to 410 copies everything is stable, the memory is static, low CPU usage. When I run 450 copies or more, the console applications go crazy, memory in the task manager starts to jump, 100% CPU usage.

link

answered Jun 04 at 04:55

Striker's gravatar image

Striker
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×7
×2

Asked: Jun 03 at 09:11

Seen: 92 times

Last updated: Jun 04 at 04:55

powered by OSQA