By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,091 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,091 IT Pros & Developers. It's quick & easy.

Need help with telnetlib flakiness

P: n/a
I'm trying to use telnetlib to run a Java program on a remote server.
I'm having strange problems, and I'm wondering if anyone might be able
to help.

I have two UNIX servers, A and Z.

I have an application named LATTE that runs on server A. When the
user starts LATTE, the user can choose to create a telnet connection
back to A, or to Z. Then LATTE uses the telnet connection to run a
Java program (run it several times, on different input files) on the
selected server. After each run, it uses read_until() to wait from
the prompt to reappear before running the program on the next input
file.

I have no problems when LATTE is connecting back to A. Everything
works fine. But when connecting to Z, strange things happen. The
program runs fine on the first file, then on subsequent files does
nothing but write a series of beeps (\x07) to the console until the
telnet connection read_until() times out.

I've checked out all the reasonable possibilities : differences in
executables, differences in input files, which file is the first to be
processed, etc. The problem is not in the command itself -- on Z, I
can run the program just fine on each input file if I execute the
identical command from an interactive telnet prompt.

So I appear to be getting the flaky behavior only when running the
program via Python's telnetlib (not interactively from the console),
when connected to the remote server (Z), not the home server (A), only
on the second and subsequent input files (not on the first).

I'm buffaloed. Does anybody have any ideas what might be going on?
Is telnetlib reliable?

-- Steve Ferg

P.S. Here's my code:
=============================

cmd = ("java " + classpathSpec
+" " + classfileName
+" " + inFilename
)
cmd += "\n"

argTelnetConnection.write(cmd)

results = argTelnetConnection.read_until(argPromptString,30)
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Anybody.....?
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.