Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

SSHTUNNEL CPU Load 100%

$
0
0

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.

Viewing all articles
Browse latest Browse all 1061

Trending Articles