Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

multiupload thread queue

$
0
0
Hi, I'm just a newbie and try to do mutltiupload to a php script.

My app talk to an external app
This external app put some files in a backup directory and send to my app a signal alet

My app receive this signal (a specific message) via the Overrides Sub WndProc()

When I receive the message, I know that there is a file to upload to my webserver.
Code:

Sub WndProc()
......
ThreadPool.QueueUserWorkItem(AddressOf AutoUpload, upldData)
......
end sub


Code:

delegate D_AutoUpload(dt as object)
sub AutoUpload(dt as object)
.......
StatusCode = upload(filepath, UrlWebsite)
if statuscode = "OK" then
deleteFile(filepath)
end if
......
end sub


Code:

Function upload(filepath as string, UrlWebsite as string)

.......
.......(upload & update a progressBar)
.......
Return statusCode
end sub

A upload maybe a little bit longer and sometimes I have to upload another one before my previous file is completed.
Because I receive several signals alert in 5 or 10sec and a upload is about 10sec to 2mins by file.
I must upload all files one by one in the correct order.
I would like to wait the previous upload accomplished before to upload the next one.
I think, I have to use thread, queue, maybe threadpool but don't have any Idea.

If someone could tell me how to do, It will be very appreciated.
Thanks in advance
Isa

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>