Help! No connection could be made because the target machine actively refused it

Aug 22, 2012 at 1:26 PM

I am working to get the SFTP assembly set up and working in by VB.NET application, but am running into issues.

First, here's the code:

Try
    sftp.Connect(_FTPLocation, New Net.NetworkCredential(_FTPUsername, _FTPPassword), Client.ESSLSupportMode.All)
    sftp.SetCurrentDirectory("to_hh")
    sftp.SetTransferMode(Common.ETransferMode.Binary)
Catch ex As Exception
   console.WriteLine(ex.Message)
   sftp.Close()
End Try

For FileLooper = 0 To FilesToSend
    RootName = System.IO.Path.GetFileName(_FilesCreated(FileLooper))

    Try
        BytesSent = sftp.PutFile(_FilesCreated(FileLooper), RootName)
    Catch ex As Exception
        Console.WriteLine(ex.Message)
        sftp.Close()
    End Try
Next

Connection works.

SetCurrentDirectory works.

As soon as I try the PutFile, I get:

No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:4037

Any help would be GREATLY appreciated!

Steve

Aug 22, 2012 at 2:00 PM

Here is a log from FileZilla that connects and allows file transfers:

2012-08-22 08:57:29 3884 6 Status: Connecting to <somehost>.com...
2012-08-22 08:57:29 3884 6 Response: fzSftp started
2012-08-22 08:57:29 3884 6 Command: open "<someuser>" 22
2012-08-22 08:57:30 3884 6 Command: Pass: ********
2012-08-22 08:57:30 3884 6 Status: Connected to <somehost>.com
2012-08-22 08:57:30 3884 6 Status: Retrieving directory listing...
2012-08-22 08:57:30 3884 6 Command: pwd
2012-08-22 08:57:30 3884 6 Response: Current directory is: "/"
2012-08-22 08:57:30 3884 6 Command: ls
2012-08-22 08:57:31 3884 6 Status: Listing directory /
2012-08-22 08:57:31 3884 6 Status: Calculating timezone offset of server...
2012-08-22 08:57:31 3884 6 Command: mtime "from_hh"
2012-08-22 08:57:31 3884 6 Response: 1344317726
2012-08-22 08:57:31 3884 6 Status: Timezone offsets: Server: -14400 seconds. Local: -18000 seconds. Difference: -3600 seconds.
2012-08-22 08:57:31 3884 6 Status: Directory listing successful

Thanks