Home Forums .NET libraries Xceed SFTP/FTP for .NET The command socket was disconnected from the FTP server

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20731 |

    Hi,
    I’m receiving always this message when a try to send a file:
    “The command socket was disconnected from the FTP server”
    I use the same VB code that is used in the samples, with some minor changes.

    Public Function SendFile(ByVal sFileName As String, Optional ByVal bShowProgress As Boolean = False) As Boolean
    Dim bRetVal As Boolean = False
    Xceed.Ftp.Licenser.LicenseKey = sKey
    Dim client As New AsyncFtpClient
    client.SynchronizingObject = Me
    Try
    Dim result As IAsyncResult = client.BeginConnect(oFtpCli.URL, Nothing, Nothing)
    While Not result.IsCompleted
    Application.DoEvents()
    End While
    client.EndConnect(result)
    result = client.BeginLogin(oFtpCli.Login, oFtpCli.Password, Nothing, Nothing)
    While Not result.IsCompleted
    Application.DoEvents()
    End While
    client.EndLogin(result)
    AddConnectionLogInformation(“Ligado.”, enuAlertLevel.Level_Info, False)
    Dim remoteFilename As String = System.IO.Path.GetFileName(sFileName)
    result = client.BeginSendFile(sFileName, remoteFilename, Nothing, Nothing)
    While Not result.IsCompleted
    Application.DoEvents()
    End While
    client.EndSendFile(result)
    AddConnectionLogInformation(sFileName & ” enviada.”, enuAlertLevel.Level_Info, False)
    bRetVal = True
    Catch except As FtpException
    AddConnectionLogInformation(except.Message, enuAlertLevel.Level_Max)
    Finally
    Try
    Dim result As IAsyncResult = client.BeginDisconnect(Nothing, Nothing)
    While Not result.IsCompleted
    Application.DoEvents()
    End While
    client.EndDisconnect(result)
    Catch
    End Try
    AddConnectionLogInformation(“Desligado.”, enuAlertLevel.Level_Info, False)
    End Try
    ShowTraceFile()
    Return bRetVal
    End Function

    This code is working in a Windows NT machine and in my machine, windows XP Professional SP2, but I get this message in a machine that has windows XP pro SP1.

    I’ve made some tests and the connection is ok, the login is ok, but when sending the file I get always the same error. I’ve made some tests using the console ftp application and all works well, I can send files without any problem. Only using the app that I developed, with the code I sent, I get this sending file problem.
    I’ve already disabled the anti virus.
    Can someone help me on this, any suggestion?
    Thanks,
    Eduardo

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by edazevedo (had 3313 views)

    User (Old forums)
    Member
    Post count: 23064

    The Windows command-line FTP application works in “port” mode by default, while our library works in passive mode by default, so it’s most probably related to your firewall(s). Try setting the PassiveTransfer property to False.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 267 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, that solve the problem.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by edazevedo (had 4085 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.