Server getting intimation of disconnection while file is downloaded from client side  
Author Message
TA123





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

I have a problem,

There is a file being transferred to an .Net application via HTTP protocol by a J2EE web application.

Now I want to trap the client disconnection event at Server Side if Download fails from client side.

I have thought some approaches but not fully satisfied with those:

1. Just open a separate thread from client that will tell the server periodically that client is alive, till file gets transferred.

2. Server should ping the client periodically, if client is available, but this would be a violation of HTTP protocol.

In case 1 ,  I would have to make a service or exceutable on client side which i would like to attempt as the last case. I would like client to be just using webbrowser.


Please comment on my ideas and pour in with the best architecture to solve this issue (regardless of whether it is one of my ideas or not).

regards



Architecture2  
 
 
Pranshu





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

For server to server transfers, I tend to do a 2-step upload

First I upload the filename and get some kind of a Unique ID back,

Then I upload the file against the ID.

Once uploaded, the client can check the server for that ID - for parameters like file size. That way the client can know if the file was uploaded properly.

Pranshu



 
 
Arnon Rotem Gal Oz





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

Why do you need to create code on the end user's machine

Can you handle the checks on the Java side (e.g. have a servlet monitor things on the web server and have that contact the .NET server)

Arnon



 
 
rajivnahata





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

Thanks to both of your for replying

Yes Arnold, i would like to no code on the client side.

I can do check but don't know how to do it.

please explain how server will be getting information from client whether it have downloaded the file properly or was there any disconnection before that.

Pranshu,

I think i was not able to put across my question to you properly.

Client is downloading file from server.Server should be getting information from client whether it have downloaded the file properly or was there any disconnection before that.

Kindly provide you comments in the above scenario

rgds


 
 
Sivasakthivel





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

Hi,

Your topic is little bit misleading. If i understand it correctly, you want the client to intimate the server in case of it not able to download the file properly. As a general suggestion, you can create a header or an xml string containing detail about the file getting transffered to the client. Client can reconnect to the server in case if it fails to receive the complete file. I understand there is a .net server application and java based client application.

Even in the case of server getting to know about the client disconnection, server cannot establish a connection with the client application. So it should be the responsibility of the Client to initiate. I dont know if client can make this necessary changes to accomodate receiving information about file details and then download the file.

If the change at Client side is not possible then you can think of other alternatives.

Regards
Sakthi.

 
 
Pranshu





PostPosted: Architecture General, Server getting intimation of disconnection while file is downloaded from client side Top

I dont believe the client code can be avoided completely. You could put a wrapper around the file being downloaded ( like Soap with attachments), hence the client will know that the file is proper and re-request if not. Or you can use headers - like file size - so that the client knows that it has everything, But the client ( or the recieving end) will have to notify the sender explicitly of the same. As far as I know, HTTP protocol has no provision for intimating the server of the status of data transfer - so you are unlikely to find something at the server which can tell you exactly the state of download.

I may be wrong so would definitely want to know if there is something available.

Pranshu