Results 1 to 2 of 2

Thread: FTP Problem - An existing connection was forcibly closed by the remote host

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    FTP Problem - An existing connection was forcibly closed by the remote host

    I got this class that deal with all FTP functionality, and must admit, I dont know much how it work. I basically just edited it a bit for my own use, and seems to work fine.
    Before I have been on a shared Win2K host, and the FTP functionality worked fine. But now we moved to a Win2K3 Dedicated server (yes, FTP to a remote server), this problem start occuring after FTP'in a few files up. It work for a while, then start with this error:
    An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll
    Additional information: An existing connection was forcibly closed by the remote host
    The error occur on the line that reads:
    in this code: clientSocket.Send(cmdBytes, cmdBytes.Length, 0);
    Code:
    private void sendCommand(String command)
    {
    
    	Byte[] cmdBytes = Encoding.ASCII.GetBytes((command+"\r\n").ToCharArray());
    	clientSocket.Send(cmdBytes, cmdBytes.Length, 0);
    	readReply();
    }
    I attached the class I am using. For those looking for ftp functionality in their c# application, feel free to use it. Works (oops...worked) like a bomb for me.
    Attached Files Attached Files
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: FTP Problem - An existing connection was forcibly closed by the remote host

    What is your your socket timeout length?
    I don't live here any more.

Posting Permissions

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



Click Here to Expand Forum to Full Width