sendtoserver problem with virtualterminal

0 votes
asked Nov 3, 2011 by Allan (160 points)
edited Jul 16, 2014

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?

commented Nov 4, 2011 by Lukas Matyska (59,450 points)
edited Nov 8, 2011

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
answered Jul 16, 2014 by Pavel Matyska (14,020 points)
edited Jul 16, 2014

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

...