Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: Intermitant An existing connection was forcibly closed by the remote host
LeeBates
Lee@AboutPCI.com

From: Hartselle, AL USA
Posts: 3
Member Since: 03/31/06
posted March 31, 2006 9:00 AM

I have a VB.NET application that is deployed accross 10 to 20 laptops at a time. Every night, these reps transmit data to our server. We have a 98% success rate. Every once in a while, we get the following exception:
An existing connection was forcibly closed by the remote host
sometimes just retrying works, usually between retries or waiting untill morning to retry works.

Is there a setting on the server that I can tweak that will reduce the odds of this happenning?

My settings:
  Ftp1.Username = cmsAP.FTPLogonID
  Ftp1.Password = cmsAP.FTPPassword
  Ftp1.ServerPort = cmsAP.FTPServerPort
  Ftp1.Server = cmsAP.FTPServer
  Ftp1.FileType = FileType.Ascii
  Ftp1.DoEvents = True
  Ftp1.Passive = False
  Ftp1.Timeout = 30000

  Try
    Dim Results() As FtpFile
    Call LogEvent("Sending meeting results")
    StepName = "Transmitting " & MyFileName & " to " & cmsAP.FTPServerDirectory
    Results = Ftp1.Put("C:\", MyFileName, cmsAP.FTPServerDirectory, True)

    StepName = "Checking Results For Rep File"
    MeetingDataSent = CheckResults(Results)
    If Not MeetingDataSent Then
     '------ Try Once More ------
      StepName = "ReTransmitting " & MyFileName & " to " & cmsAP.FTPServerDirectory
      Results = Ftp1.Put("C:\", MyFileName, cmsAP.FTPServerDirectory, True)
      MeetingDataSent = CheckResults(Results)
    End If

  Catch exElse As Exception
    NoErrorEncountered = False
    MsgBox("ATTEMPTING:" & StepName & vbCrLf & "ERROR: " + exElse.Message)
    Ftp1.Abort()
  End Try
  If Ftp1.Connected Then
    Try
     Ftp1.Close()
    Catch
     Ftp1.Abort()
    End Try
  End If

Thanks for your efforts,
Lee Bates
Raj

From: Rome, NY, USA
Posts: 389
Member Since: 02/01/06
posted March 31, 2006 2:58 PM

Hello Lee,

As your application seems to be performing PORT transfers, you might want to try limiting the listening ports to a certain range, and making sure incoming connections are permitted on that range. But if the range is too small. you might run into reuse issues.

Sometimes the problem can be with the server, and there is not really a lot that you can do.
Your best bet might be to simply have your app remember which transfers failed, and then retry them later.

-Raj
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX