Ask a questionAsk a question
 

General DiscussionProblem with FTPWebrequest

  • Friday, October 30, 2009 7:44 AMKartheechidambaram Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I am doing a project on FTP file-transfer using FtpWebRequest class. While transferring the file, if my network connection gets disconnected the file in the receiving end gets hanged. I am not able to process further even though I re-establish my network connection. After some time the file gets removed; then I am able to put the file again. What is the problem? Is the class is designed in that manner?

    Receiving End Means - the machine in which the ftp server runs,and im the who sends the file from a machine without FTP.

    • Changed TypeKartheechidambaram Tuesday, November 03, 2009 5:16 AMmistakenly selected the topic
    •  

All Replies

  • Tuesday, November 03, 2009 11:56 PMMr. Javaman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You have two layers to consider here 1) FTP and 2)TCP/IP...

    TCP rules state that if there is no response from a client it will attempt to recover before disconnecting the session.  It does this in a special way attempting to resend the packets repeatedly over a certain period of time.  If after that attempt is exhausted, nothing happens TCP will quit the session.

    FTP runs on top of TCP layer, so if the TCP layer never detects lost packets then somehow FTP is still in action.  Perhaps there is a keep alive configuration parm for no response to a send.  The FTP layer has two sessions, 1 for the controller and the other for the data transfer.  If the host is getting hung then it's a host problem.  Simple as that...  All errors should be able to be recovered by a host.  You didn't mention what type of host it is.
    Javaman
  • Wednesday, November 04, 2009 2:38 PMKartheechidambaram Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    if host in the sense ftpserver means it is the Default ftp service available in windows. how to recover if the host gets hunged ,because from the client side how it is possible to control the server(ftp).

    you said it will be recovered by the host,what it means the connection timeout in the server?


    you said juz like that but  i have been working out to resolve this for 2weeks.
  • Friday, November 06, 2009 2:12 PMMr. Javaman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Ok let's start with a map

    Client---------->Server

    Client sends request to server (either a put or get of a file)
    Network connection drops during transmission.

    Which side is hanging?  Client or Server?
    Javaman
  • Thursday, November 12, 2009 5:32 AMKartheechidambaram Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    On the server side file got hanged.

    (Note: I found a workaround for this for TimeBeing, i reduced my connection Timeout on the FTPSever,so if a file gets hanged ,my clientprogram will wait for a minute or two(for the connection timeout) and starts with a new connection and sends the file