Re: Trapping for error and displaying receive buff (General questions)
Same issue happens. Can You please explain what is happening here:
[code]
Telnet1.Connect()
On Error GoTo ErrorHandler
Telnet1.WaitFor( p5104 - Select: )
Telnet1.DataReady = 0
Telnet1.Execute( T & vbLf, p5104 - Select: )
[/code]
Lines:
1 - Connect to host
2 - On Error call special Handler
3 - Receive the output from the host and wait for string p5104 - Select:
4 - Turn off receive buffer for next command
5 - Send T to host and receive output to buffer and wait for string p5104 - Select:
[size=2]Prompt Method[/size]
[code]
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
.
.
.
Telnet1.Prompt = p5104 - Select:
ExecCount = 0
Telnet1.Connect()
End Sub
Private Sub Telnet1_PromptReceived() Handles Telnet1.PromptReceived
Select Case ExecCount
Case 0
AddToList(Telnet1.Prompt)
Telnet1.Prompt = p5104 - Select:
Telnet1.Send( T & vbLf)
Case 1
AddToList(Telnet1.Prompt)
Telnet1.Prompt = (c)Eagle Con&Dev
Telnet1.Send( e51 & vbLf)
Case 2
.
.
.
End Select
ExecCount = ExecCount + 1
End Sub
[/code]
Here the prompt is defined before the Connect method. This way the output buffer is scaned for the string p5104 - Select: . When the string is found it raises the Telnet1.PromptReceived Event which is then handled by the case statement above.
Is there a difference of when the buffer is received and lost with the WaitFor and Execute method? What I mean is that the only time a Timeout event can be raised if it does not find the string in the received buffer. This is turned off for WiatFor and Execute so where is the buffer to read the data stream?
Complete thread:
- Trapping for error and displaying receive buffer a - Eric, 2007-12-07, 14:32
- Re: Trapping for error and displaying receive buff - wodDamir, 2007-12-07, 15:32
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:12
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 16:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:46
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:25
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 17:30
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:45
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:22
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:26
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:32
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:39
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:52
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 20:06
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 20:29
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 21:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:03
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 22:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 14:55
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-10, 15:09
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 15:21
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 16:05
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 15:21
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-10, 15:09
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-10, 14:55
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 22:18
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 22:03
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 21:18
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 20:29
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 20:06
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:52
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:39
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:32
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 19:26
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 19:22
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:45
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 17:30
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 17:25
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:46
- Re: Trapping for error and displaying receive buff - woddrazen, 2007-12-07, 16:37
- Re: Trapping for error and displaying receive buff - Eric, 2007-12-07, 16:12
- Re: Trapping for error and displaying receive buff - wodDamir, 2007-12-07, 15:32