Login  
Search All Forums
Dart Home | PowerTCP Telnet for .NET | Custom Development Reply | PowerTCP Telnet for .NET Topics | Forums   
AuthorForum: PowerTCP Telnet for .NET
Topic: get Exception: dart.telnet.dataexception
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 29, 2011 11:13 AM

I am trying to write a vb.net program that runs at command prompt. And loops while logging into telnet server. I get an dart.telnet.dataexception error that reads
"dart.telnet.dataexception: inner exception thrown before finding specified delimiters. My code looks like this: (error happens at
TelnetControl.TerminalType = "vt100")


Imports Dart.Telnet
Module Module1

  Sub Main()
    Dim intLoopIndex As Integer
    For intLoopIndex = 0 To 100
      opentelnet(intLoopIndex)
      System.Threading.Thread.Sleep(10000)
          Next intLoopIndex
  End Sub

  Private Sub opentelnet(ByVal intLoopIndex As Integer)
    Dim TcpSession As Dart.Telnet.TcpSession = New Dart.Telnet.TcpSession()
    TcpSession.RemoteEndPoint.HostNameOrAddress = "myserver.com"
TcpSession.RemoteEndPoint.Port = 23
Try
TelnetControl.TerminalType = "vt100"
TelnetControl.Connect(TcpSession)
TelnetControl.ReadToDelimiter("Name:")
TelnetControl.Write("username" + vbCrLf)
TelnetControl.ReadToDelimiter("Password:")
TelnetControl.Write("password" + vbCrLf)
System.Console.WriteLine(TelnetControl.ReadToDelimiter(":"))
Catch Ex As Exception       System.Console.WriteLine(Ex.ToString, False)
End Try
End Sub

  Public m_Telnet As Dart.Telnet.Telnet

  Public ReadOnly Property TelnetControl() As Dart.Telnet.Telnet
    Get
      m_Telnet = New Dart.Telnet.Telnet
      Return m_Telnet
    End Get
    End Property
End Module

____
Can anybody tell me what I am missing or have wrong.
Nick B (Admin)

From: Utica, NY USA
Posts: 572
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted August 29, 2011 12:47 PM

Hello,

Does this occur on the first time through the loop, or one of the subsequent calls to opentelnet()?

Is TelnetControl supposed to be a new telnet control each time the loop begins again after sleeping?
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 29, 2011 12:50 PM

Happens first time it runs.

Telenet control does not have to be a new control. as long as I can use it over and over again.
Nick B (Admin)

From: Utica, NY USA
Posts: 572
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted August 29, 2011 1:07 PM

Hello,

I've copied your code into a VS2010 project, and was unable to reproduce your issue with our server. What is the inner exception?
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 29, 2011 1:21 PM

here is entire error in command prompt screen.

Dart.Telnet.DataException: InnerException thrown before finding specified delimi
ter(s). ---> System.NullReferenceException: Object reference not set to an insta
nce of an object.
  at 0.0.Write(Byte[] buffer, Int32 offset, Int32 count)
  at 0.2.0(Command , OptionCode )
  at 0.2.1()
  at 0.2.Read(Byte[] buffer, Int32 offset, Int32 count)
  at System.IO.Stream.ReadByte()
  at Dart.Telnet.TcpBase.ReadToDelimiter(String[] delimiters)
  --- End of inner exception stack trace ---
  at Dart.Telnet.TcpBase.ReadToDelimiter(String[] delimiters)
  at Dart.Telnet.TcpBase.ReadToDelimiter(String delimiter)
  at telnet_mud.Module1.opentelnet(Int32 intLoopIndex) in c:\users\russell\docu
ments\visual studio 2010\Projects\telnet_mud\telnet_mud\Module1.vb:line 37
Message to user: 0
Nick B (Admin)

From: Utica, NY USA
Posts: 572
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted August 29, 2011 2:50 PM

Hello,

That exception specifies that it is failing at a ReadToDelimiter call; can you step/break through your code to determine which one?

Your project name specifies MUD; is this a server we can connect to to test against? We may be failing after an optioncode response.

Are you able to connect to your server with the included Telnet Client sample?

Can you provide us with a trace log, as would be provided from the Telnet Client sample?
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 29, 2011 4:48 PM

Line error tells me it failed on TelnetControl.TerminalType = "vt100". But it could be incorrect.

included telnet sample works okay. But I need to use TelnetControl.ReadToDelimiter("Name:")
(i thinbk sample uses something else)

Yes I can give you access to mud. But I would prefer to send you server address, port, user/pass in a private email. How can I get you that info?

I will try the step/break also and get back tou you.
Nick B (Admin)

From: Utica, NY USA
Posts: 572
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted August 29, 2011 5:04 PM

Yeah, just with the call stack specified in the exception, it couldn't be on the .TerminalType line.

You can send it into support@dart.com

What is the version listed on the dll you're referencing?
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 29, 2011 6:41 PM

Thanks info was just sent via email.

I will send dll ver on yues.
creatinggenius

From: Saratoga Springs, NY USA
Posts: 10
Member Since: 08/29/11
posted August 30, 2011 10:28 AM

i was able to get this to work. I took automated console sample and made changes to it.

it now works well. thanks
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 377
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted August 30, 2011 1:06 PM

Thank you for the update and we're glad your issue has been resolved. Please feel free to post with any additional questions.
Reply | PowerTCP Telnet for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX