0 votes
by (160 points)
edited

The client machine requires a user login immediately after the client connection is established. I wrote some code several months ago that connected to the client and then proceeded to input long strings of information via virtual terminal. Worked fine when initially implemented, but builds done in the last week are hanging on the login screen.

Pseudocode below:

terminal.Options.FunctionKeysMode = FunctionKeysMode.XtermR6
terminal.Options.NewLineSequence = NewLineSequence.CR
terminal.Options.Encoding = Encoding.Default
''# add echo for debugging purposes
terminal.Options.LocalEcho = True

terminal.Bind(client)

terminal.SendToServer("username" & vbCr)

Dim state As TerminalState

Do
   ''# wait 0.5 seconds for the response
   state = Term.Process(500)
   ''# if there was a response, try processing more
   ''# Some error checking code here to make sure that the virtual terminal is in the  right place 
Loop While state = TerminalState.DataReceived

terminal.SendToServer("password" & vbCr)

Do
   ''# wait 0.5 seconds for the response
   state = Term.Process(500)
   ''# if there was a response, try processing more 
Loop While state = TerminalState.DataReceived

Testing shows that the username is being sent properly, the carriage return is taking the cursor to the password line, the password is being entered, but nothing is happening at the second carriage return sequence.

I have tried using NewLineSequence(CRLF) with vbcrlf, System.Windows.Forms.Keys.Enter to do the enter key emulation, all but the last produced the same result, System.Windows.Forms.Keys.Enter sent the unicode character number instead.

Client system is running Ubuntu 6.06

Any suggestions on how I can approach this?

by (73.6k points)
edited

Can you please send the session recording and communication log to support@rebex.net. It would help us determine the source of the hanging problem.

To create session recording and communication log just add the following two lines before the terminal.Bind(client) call.

client.LogWriter = new Rebex.FileLogWriter("C:\temp\log.txt", Rebex.LogLevel.Debug)
terminal.Recorder = new StreamWriter("C:\temp\recording.txt")
terminal.Bind(client)

1 Answer

0 votes
by (15.2k points)
edited

Hi, we have just release new Scripting API in 2014-R2 release. You can read more of its features on Scripting features page.

...