Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Question Unanswered: Requested timeout on inet

    In my application I have a procedure that check a file on a host. The attached routine function as it was designed for as long as the host is up running.

    If host has stopped or is not available, the routine fails and I get the error code 35761 (Requested timeout)
    My application informs about this and continue to run. The problem is that it seems to get onto a kind of hang. It stops responding and I need to terminate my application the hard way. (task manager)

    If I unplug the network connection, the procedure fails with the error code 35754 (unable to connect to remote host) The program inform about this and continue normally.

    Does anyone have any clue what the reason to this can be?
    Any proposal would be greatly appreciated.

    Thanks
    Code:
    Function test()
        Dim host_name As String, To_Path As String
        Dim objFTP
        Dim Username As String, Password As String, RequestTimeout As Byte
    
        Username = "Vestigo"
        Password = "Somethingsecret"
        RequestTimeout = 5        'seconds
    
        From_Path = "\New_Versions\"
        host_name = "ftp://82.124.9.134"
         
        Set objFTP = Me.axFTP.Object
        
        With objFTP
            .URL = host_name
            .Username = Username
            .Password = Password
            .RequestTimeout = RequestTimeout
            .Execute , "Dir " & From_Path & "Vestigo_*.txt"
        End With
     
        GoTo Exit_Function
    Connection_Error:
    
    Select Case Err
        Case 35754
            MsgBox "No connection to internet"
        Case 35761 
            MsgBox "Timeout due to host problems"
    End Select
        
    Exit_Function:
        Set objFTP = Nothing
    End Function
    Last edited by vestigo; 02-20-07 at 17:50.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    try:

    If Err.Number = 35754
    MsgBox "No connection to internet"
    Exit Function
    Elseif Err.Number = 35754
    MsgBox "Timeout due to host problems"
    Exit Function
    End If
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •