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?