Login  
Search All Forums
Dart Home | PowerTCP Emulation for .NET | Custom Development Reply | PowerTCP Emulation for .NET Topics | Forums   
AuthorForum: PowerTCP Emulation for .NET
Topic: auto logoff of telnet client
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted January 13, 2004 11:42 PM

I remember that when using the activex emulation tool I was able to print a string "Finished" and the telnet client would recognized that it had been printed and then I could execute a logoff in VB6. How might this be accomplished with the .net emulation tool. I have been able to get this to work by typing "Finished" and then typing enter (ie carriage return) with the following code:
 Private Sub telnet1_EndReceive(ByVal sender As Object, ByVal e As Dart.PowerTCP.Telnet.SegmentEventArgs) Handles telnet1.EndReceive
        If e.Segment.ToString.IndexOf("FINISHED") > 0 Then
           telnet1.Close()
          Me.Close()
        End If

I do not want to issue a carriage return just print "Finished" and then have this recognized in .net code. Also what event would the code be placed in?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 13, 2004 11:55 PM

Use the WaitFor method.
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted January 14, 2004 12:19 AM

Tony, what event might this be spaced in?
also it this the proper syntax:

If telnet1.WaitFor("FINISHED") Then
   'close session
end if
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 14, 2004 9:13 AM

You wouldn't really want to put it in an event. WaitFor is a blocking method meant for use in scripting type apps where all the responses are known and if they are not received there is an error.

If you have to do what you are doing, you'll have to keep a buffer of the last 8 characters you received and always check if they are equal to "FINISHED"
bobm
bmodrich@gmail.com

From: Murrieta, CA USA
Posts: 30
Member Since: 01/13/04
posted January 17, 2004 2:28 PM

Tony, now that I have purchased product and a subscription where would I get support on implementing the buffer approach you referred to.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 17, 2004 3:52 PM

It appears you bought preferred support. That being the case, please call 315-790-5456 on Monday. Someone will track me down.
Reply | PowerTCP Emulation for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX