Login  
Search All Forums
Dart Home | PowerTCP Emulation for ActiveX | Custom Development Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums   
AuthorForum: PowerTCP Emulation / Telnet for ActiveX
Topic: Telnet Timing Issue?
MJMoore

From: Naperville, IL USA
Posts: 2
Member Since: 11/15/05
posted November 15, 2005 1:07 PM

This is kind of an odd problem that I am having. I am creating a connection to a HP Unix box using the Telnet Tool. Once the connection is made I then sending several environment commands and then finally attempt to run a cobol program. Once I get a response, I clos the connection. Here is waht the code looks like:


  Public Function GetConnection() As Dart.PowerTCP.Telnet.Telnet

    Dim telnet1 As New Dart.PowerTCP.Telnet.Telnet
    Dim CommandString, data As String
    Try
      telnet1.KeepAlive = True
      telnet1.NoDelay = True
      telnet1.Echo = OptionState.Off
      telnet1.ReceiveTimeout = PCConnectionTimeout
      telnet1.ConnectTimeout = 25
      telnet1.Login(PCUnixServerName, PCUnixUsername, PCUnixPassword, "->")
      CommandString = "33u" & vbCr
      telnet1.Send(CommandString)
      data = telnet1.WaitFor("]:")
      telnet1.Send(vbCr)
      telnet1.Send(vbCr)
      data = telnet1.WaitFor("]:")
      GetConnection = telnet1

    Catch ex As Exception
      GetConnection = telnet1


    End Try
  End Function



Private Function TelnetFlattenFile(ByVal e As FileClass) As Boolean
    Dim oExtractTelnet As New Dart.PowerTCP.Telnet.Telnet
    Dim data, CommandString As String

    Try

      oExtractTelnet = GetConnection()

      If oExtractTelnet.Connected Then

        ' Note this environment manipulation is temporary
        ' and will be removed from production
        '---------------------------------------------------
        CommandString = "newgrp rdb" & vbCr
        oExtractTelnet.Send(CommandString)
        'data = oTelnet.WaitFor("COMPLETE")

        CommandString = "export COBPATH=/rims/RDB/:$COBPATH;echo 'COMPLETE'" & vbCr
        oExtractTelnet.Send(CommandString)
        data = oExtractTelnet.WaitFor("COMPLETE")
        '---------------------------------------------------
        CommandString = "export COBEXTFHBUF=65535;echo 'COMPLETE'" & vbCr
        oExtractTelnet.Send(CommandString)
        data = oExtractTelnet.WaitFor("COMPLETE")

        CommandString = "cd " & CWUnixPackagesLocation & Sandbox & ";echo 'COMPLETE'" & vbCr
        oExtractTelnet.Send(CommandString)
        data = oExtractTelnet.WaitFor("COMPLETE")

        CommandString = "cobrun d" & e.FCCISAMFileName & ";echo '" & e.FCCISAMFileName & "'" & vbCr
        oExtractTelnet.Send(CommandString)
        data = oExtractTelnet.WaitFor(e.FCCISAMFileName)
        oExtractTelnet.Close()
        oExtractTelnet.Dispose()
        oExtractTelnet = Nothing

        Return True
      Else
        oExtractTelnet.Close()
        oExtractTelnet.Dispose()
        oExtractTelnet = Nothing
        Return False
      End If

    Catch ex As Exception
      oExtractTelnet.Close()
      oExtractTelnet.Dispose()
      oExtractTelnet = Nothing
      Return False
    End Try

  End Function

I run this code in a very large loop which runs these cobol programs for a selected group of files. The output from the COBOL program is an extracted CISAM file. This works fine for the first 4 to 5 times through. However, for some reason it appears to stop sending the cobol run command. I know this because no output file is created.

Oddly, when I step through this using the debugger, it does not happen.

Any thoughts? Am I opening and closing a connection too quickly?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted November 15, 2005 1:17 PM

Unfortunately it's really hard to tell what's going on without access to the same code and server that you are using.

If you would like us to troubleshoot this for you, please send a request to support@dart.com with a reference to this forum post (#6210) and someone should contact you.
MJMoore

From: Naperville, IL USA
Posts: 2
Member Since: 11/15/05
posted November 15, 2005 3:22 PM

I understand. I will try a few other things before I pull the support trigger. I'm going to fire up an Ethereal session now and see what is being sent to the server.

Thanks for your time.

Mike

Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX