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: using AUTOLOGIN sample
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 7, 2004 3:41 AM

When I use the autologin sample it works fine. But still I do not know what should be sent for COMMAND. After many tries , I send 1 and it worked fine. I could log in..

Can you kindly tell me what is COMMAND expecting?

Moreover, after i login, my server will actually list a menu and i need to choose from the menu.

when I try to add few more lines in the existing code, for example searching for the menu and sending the value to it, it raises the error.

I think if I know what should be sent in COMMAND text, I think everything would work fine.

Thanks
Beula
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 7, 2004 4:20 AM

well, it works even after i comment the COMMAND Prompt textbox.

But when i try to add few more lines to the sample code, it doesnot work fine..

first part of my code.

Telnet1.Connect Session("HOST"),23
' Dim a string to be used by the search method
If Err.number = 0 then
 Dim Data
 Data = ""
' Search for login prompt
 Telnet1.Search Data, Session("LOGINPROMPT")
 If Err.number = 0 then
 AddResult Data
' Send username
 Telnet1.Send Session("USER") + vbCrLf
 Data = ""
' Search for password prompt
 Telnet1.Search Data, Session("PASSPROMPT")
 Telnet1.Send Session("PASS") + vbCrLf

 Data = ""

' when i added the below lines it prompts me error.
Once I login, it will display a menu with options 
1. Status Display
2. Stock Control

and then it will prompt asking for option no. for the user to enter either 1 or 2 as below
 Option no. :

And so I used the below lines and passing 1
  
 Telnet1.Search Data,"Option no. : "

  If Err.number = 0 then
   AddResult Data
  Telnet1.Send "1" + vbCrLf

it prompt me error message when i just added these few lines.

Can you please guide me of how to resolve this.

Thanks
Beula
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 7, 2004 5:11 AM

Hi,

I could even get this problem solved but i prompts me an error message when I enter the option no. to 1.

ERROR #10057: Receive or Send method failed. The socket is not connected.

This is the error i get in that line

thanks
Beula
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 7, 2004 9:41 AM

The problem with searching is, you have to know exactly what you are searching for before you can search for it.

In the example you mention, COMMAND is the command prompt that appears after a command has completed.

In your case, you need to use detailed logging. You can use the Trace method of the Telnet control to do this. The examples show how. Look at the log to find what text you need to search for.
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 2:46 AM

Hi

I am searching for the word "Select one of the above options:", it always returns me error.

ERROR #10057: Receive or Send method failed. The socket is not connected.

I know that the spelling, the case are all correct. But I do not know why it returns such an error message.

There are some spaces before the "Select one...". Do I need to specify the exact amount of spaces also to search for the word.
Can I search for the part of the word, like "above options:"

kindly help me on this.

Thanks
Beula
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 2:51 AM

this is what my log file says.But I do not understand what it says.

============================================
#6MAIN MENU
============================================

1) STOCK CONTROL SYSTEM


2) SET VMS PASSWORD


E) Exit

Option no. : 
---> 1

<--- 1

<---
%BAS-F-IO_CHANOT, I/O channel not open

<---
-BAS-I-ON_CHAFIL, on channel 11 for file at user PC 000025D6
-BAS-I-FROLINSUB, from line 1020 in subprogram JURNAL
-BAS-I-FROLINGSB, from line 99 in GOSUB 30 in module PROFMNU
-BAS-I-FROLINMOD, from line 20 in module PROFMNU
%TRACE-F-TRACEBACK, symbolic stack dump follows
module name   routine name           line    rel PC  abs PC

                              000ADB0F 000ADB0F
----- above condition handler called with exception 001A804C:
%BAS-F-IO_CHANOT, I/O channel not open
-BAS-I-ON_CHAFIL, on channel 11 for file at user PC 000025D6
-BAS-I-FROLINSUB, from line 1020 in subprogram JURNAL
-BAS-I-FROLINGSB, from line 99 in GOSUB 30 in module PROFMNU
----- end of exception message
                              000ADB0F 000ADB0F
----- above condition handler called with exception 001A804C:
%BAS-F-IO_CHANOT, I/O channel not open
-BAS-I-ON_CHAFIL, on channel 11 for file at user PC 000025D6
-BAS-I-FROLINSUB, from line 1020 in subprogram JURNAL
----- end of exception message
                              000ADB0F 000ADB0F
----- above condition handler called with exception 001A804C:
%BAS-F-IO_CHANOT, I/O channel not open
-BAS-I-ON_CHAFIL, on channel 11 for file at user PC 000025D6
----- end of exception message
                              000B8ECE 000B8ECE
                              000B0019 000B0019
JURNAL     JURNAL              363   0000009A 000025D6
PROFMNU$MAIN  PROFMNU$MAIN           216   0000040C 0000220C
PROFMNU$MAIN  PROFMNU$MAIN           100   0000003F 00001E3F

<---
     
A FATAL ERROR HAS OCCURRED!!!
PLEASE CONTACT YOUR SYSTEM MANAGER!
 SCPROFILE  logged out at 8-SEP-2004 14:41:09.69

Thanks
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 8, 2004 8:52 AM

You can search for a single character if you want, it's not based on words. From what I can see the words "Select one of the above options" do not appear in the data you received. That is why you are getting the error.
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 9:40 AM

I getting the error

Receive and send error. Socket is not connection.

How do I get rid of the problem?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 8, 2004 9:47 AM

I'm not sure. From what I can tell of your log, there is some kind of problem with the I/O channel. Have you shown this log to your system admin?
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 9:48 AM

But I dont face any problem when I am access through command prompt.
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 9:59 AM

the problem is not in the search but in send... i dont understand why..Because it works fine when i run thru the cmd prompt
eg. telnet server

but why does that not work from the code.

guide me please
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 8, 2004 11:05 AM

After the search fails, you will no longer be connected.

Are you reconnecting after the search fails?
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 8, 2004 9:17 PM

the problem is not at the search now but when send command is called.

it gives the error , Socket is not connected. But as i know, i should not get this problem. Because I could access it through the command prompt.

thanks
Beula
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 9, 2004 1:28 AM

is there any way where I can connect the socket ( just like the one available in .NET)?

Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 9, 2004 1:29 AM

I have 1 day left to show my people here that this tool works..If it does not, all my efforts go in waste.

do help

thanks
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 9, 2004 2:47 AM

Private Sub Command1_Click()

  Dim Telnet1 As DartTelnet.Telnet
  Set Telnet1 = New DartTelnet.Telnet
 
  ' Use a 10 second timeout
  Telnet1.Timeout = 100000
  Telnet1.Trace "c:\TEMP\TelnetTrace.log", True, True, vbCrLf + "---> ", vbCrLf + "<--- "
  
  ' Connect to the host on port 23
  Telnet1.Connect "servername", 23
 
 ' Dim a string to be used by the search method
  If Err.Number = 0 Then
    Dim Data
    Data = ""
    ' Search for login prompt
    Telnet1.Search Data, "Username:"
    If Err.Number = 0 Then
      Result = Result + Data
      'Send username
      Telnet1.Send "ScProfile" + vbCrLf
     
      Data = ""
         
      Telnet1.Search Data, "Option no. :"
      If Err.Number = 0 Then
        'Send Option no.
         Telnet1.Send ("1" + vbCrLf)
         Result = Result + Data
            
        If Err.Number = 0 Then
           Data = ""
       
           Telnet1.Search Data, "options:"
           Result = Result + Data
           Telnet1.Send "1" + vbCrLf
            
               
                     
          ' Close the connection
          Telnet1.Close
           Result = Result + vbCrLf + vbCrLf + "SUCCESS!"
          Else
            ' Display info about the error
             Result = Result + vbCrLf + vbCrLf + "ERROR #" + CStr(Err.Number) + ": " + Err.Description
          End If

        Else
          ' Display info about the error
           Result = Result + vbCrLf + vbCrLf + "ERROR #" + CStr(Err.Number) + ": " + Err.Description
        End If
      Else
        ' Display info about the error
         Result = Result + vbCrLf + vbCrLf + "ERROR #" + CStr(Err.Number) + ": " + Err.Description
      End If
    Else
      ' Display info about the error
       Result = Result + vbCrLf + vbCrLf + "ERROR #" + CStr(Err.Number) + ": " + Err.Description
    End If
 
  
 Text1.Text = Result
End Sub



This is my VB Program. and the error occurs in the line   Telnet1.Search Data, "options:".

The error is


Run-time error '10057':
Receive or Send method failed.The socket is not connected.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 9, 2004 9:20 AM

This means that, for whatever reason, the server closed the connection after you sent the Telnet1.Send ("1" + vbCrLf) It's impossible for me to tell you why.

I think at this point the quickest way for you to resolve this is to contact support@dart.com to find out what support options are available. We would most likely need to connect to your server and try this out ourselves.
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 9, 2004 10:58 AM

i am scared to send the details. I can send it to you personally instead of sending to the whole of support team.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 9, 2004 11:03 AM

Sorry, but that's the only way. I am not sure that I am the one who will be assigned the issue.
Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 9, 2004 9:28 PM

Before that can you kindly check if the vb program which i have given you is correct? or are there any changes to be done on it.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted September 9, 2004 11:09 PM

At brief glance it appears to be Ok. I see a couple of things that concern me:

You have the timeout set to 100 secs but in the comment you say 10 secs.

You must have On Error Resume Next set somewhere. I would not write code like that. It makes it very easy to miss coding errors. You should do it like we do in the sample app (On Error goto OnError)

Beula

From: Singapore, Singapore
Posts: 24
Member Since: 09/01/04
posted September 10, 2004 2:32 AM

Even if I give the server details, I dont think you can access them because this is an internal server.

Any way, I sent a mail to the support team giving the server name to find out if they can connect to the server..

Kindly let me know if you can connect to the server.

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