You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Greg Hassan <gr...@net-linx.com> on 2002/11/06 22:02:15 UTC

telnet woes

Hi,

I've seen related posts on this topic a number of times, so I will be brief
and hope this helps someone.

We use the telnet task to compile code on our UNIX box(es). When telnet-ing
manually, this process takes under one minute. Using ANT's telnet task can
take several hours. The client machine also takes a big hit, others have
reported their CPU load and memory usage climbing rapidly when using telnet.

I believe the problem is the logic used in the telnet task. If no timeout is
specified, method 'waitForString()' in TelnetTask.java will run in an
infinate loop until the specified string is matched. The problem is that the
entire string buffer is searched after every byte is received. When you have
large amounts of output from telnet, this causes java to evaluate this
continually growing string very frequently.

My current work around is to redirect output to a log file so ANT won't need
to process all this text.

Perhaps a code change is in order. I will try when/if I get time.


Regards,
Greg

Re: telnet woes

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Greg Hassan" <gr...@net-linx.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Wednesday, November 06, 2002 1:02 PM
Subject: telnet woes


> Hi,
>
> I've seen related posts on this topic a number of times, so I will be
brief
> and hope this helps someone.
>
> We use the telnet task to compile code on our UNIX box(es). When
telnet-ing
> manually, this process takes under one minute. Using ANT's telnet task can
> take several hours. The client machine also takes a big hit, others have
> reported their CPU load and memory usage climbing rapidly when using
telnet.
>
> I believe the problem is the logic used in the telnet task. If no timeout
is
> specified, method 'waitForString()' in TelnetTask.java will run in an
> infinate loop until the specified string is matched. The problem is that
the
> entire string buffer is searched after every byte is received. When you
have
> large amounts of output from telnet, this causes java to evaluate this
> continually growing string very frequently.
>
> My current work around is to redirect output to a log file so ANT won't
need
> to process all this text.
>
> Perhaps a code change is in order. I will try when/if I get time.

you should file this as a bug so the world knows about it. It does sound
like a defect; I was about to suggest buffering and checking per line but
then had a horrible thought: what if someone had a match string that
included multiple lines. Does anyone do that?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>