Re: Getting disconnected automatically when large - WeOnlyDo Discussion board

Re: Getting disconnected automatically when large (General questions)

by Pradeep Nair, Wednesday, July 07, 2010, 21:49 (5041 days ago) @ woddrazen

No help, downloaded latest version, used your code.. same result.. below is code and results.
[code]
Option Explicit
Dim Host As String

Private Sub Form_Load()
wodTelnetDLX1.PrintText This sample will connect using telnet protocol to server of your choice. & vbCrLf
wodTelnetDLX1.PrintText There's really no special code needed to handle something like this... & vbCrLf
wodTelnetDLX1.PrintText Please enter hostname:
wodTelnetDLX1.TerminalEmulation = 2
Host =
End Sub

Private Sub wodTelnetDLX1_Connected(ByVal ErrorCode As Integer, ByVal ErrorText As String)
If ErrorCode = 0 Then
wodTelnetDLX1.PrintText CONNECTED & vbCrLf
Else
wodTelnetDLX1.PrintText ERROR: & ErrorText
End If
End Sub

Private Sub wodTelnetDLX1_Disconnected()
wodTelnetDLX1.PrintText vbCrLf + DISCONNECTED
End Sub

Private Sub wodTelnetDLX1_KeyPress(KeyAscii As Integer)
Dim i As Integer

If wodTelnetDLX1.State = Disconnected Then
wodTelnetDLX1.PrintText Chr$(KeyAscii)
Host = Host + Chr$(KeyAscii)
i = InStr(1, Host, Chr$(13))
If i > 0 Then
wodTelnetDLX1.PrintText vbCrLf & Trying to connect to & Left$(Host, i - 1) & ... & vbCrLf
wodTelnetDLX1.Login = root
wodTelnetDLX1.Password = rooter
wodTelnetDLX1.Connect 127.0.0.1 , 4953, 4
End If

KeyAscii = 0 'make wodTelnetDLX ignore this char internally
' it would do it anyway, since we're not connected
End If

End Sub


[/code]

Last few lines before disconnecting.
[code]
'hostname': None,
'hypervisor': 'VIRTUALBOX30',
'importancefactor': 5,
'isbackup': False,
DISCONNECTED
[/code]


Complete thread: