Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have developed one window application for upload files to http server.is it possible to use session concept in window application?if connction failure occurs while uploding files my application need to send the remaining files only after the disconnection.so that only i am asking about how to use session for that?

thanks in advance
Posted

I cannot help wondering how people can ask this weird question again and again. Windows or any other applications other then Web application never need session support. Sessions were created for Web application only due to extremely limiting character of such applications: the HTTP protocol is stateless, and the whole lifetime of the application is spanned between an HTTP request and HTTP response. You probably develop some Web application (otherwise you would not ask such question), but I cannot believe you really understand how it works.

"Normal" (not Web applications) do not have this draconian limitation, so they don't need sessions.

However, it is very likely that you question is related to something very different from sessions. It might be about transactions. You need to learn what it is. Please see:
http://en.wikipedia.org/wiki/Transaction_processing[^],
http://en.wikipedia.org/wiki/Database_transaction[^],
http://en.wikipedia.org/wiki/Atomic_transaction[^].

Please read it. Starting to catch the idea?

—SA
 
Share this answer
 
session means set a timer and when it complete a given time slot it will auto logout user (stop all running process or terminate application) - so, you can use timer in that case...

for situation of connection failure occurs while uploding files...
you should maintain a table in database

add whole list of file to upload in database and set their default value 0
as a file uploaded successfully update table record for that file and change it's state to 1 from 0

so, when a failure occur when you restart app check database and start upload of files which have state = 0 (means not uploaded)

so, it will like a Queue and you can also provide to cancel button to cancel uploading

Hope it helped you!
Happy Coding!
:)
 
Share this answer
 
v2
Comments
Raje_ 2-Jan-13 1:10am    
my +5.
Aarti Meswania 2-Jan-13 1:11am    
Thank you! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900