I was thinking about making an update server and decided to think about the most efficient way of doing so. As I could be serving a large amount of files it was impractical to have a program that sent one entire update at a time so I was thinking about looping it:
== Program Start == Load latest program files into RAM?? (Or just leave them on the hard disk?) Load the change-lists into RAM start listening == Begin Loop == Check for incoming requests If there is a request check the program numbers (and authenticate the user), if it is outdated respond with a update signal and add the connection to a array (array[clientID][file][byte] then gather a list of the necessary items into a 3d array (array[clientID][item]). If the numbers match send a 'continue' signal and terminate the connection (deleting the array). == Loop == Open an item from the connection array. Take the file (second array item) and send X amount of bytes (depending on the amount of connected clients??). == Repeat with next connection == == Repeat Loop == == Program End ==Oh and the update would look like this:
Quote
Client >> Connect:user:pass:version;
Server >> Accept:update:newVersion;
(from here on everything is split into X sized chunks)
Server >> File:include/img/pic.png:dfjw(file)dwji;
Server >> File:include/img/pic2.png:uwhewu(file)dhuw;
Server >> Accept:update:newVersion;
(from here on everything is split into X sized chunks)
Server >> File:include/img/pic.png:dfjw(file)dwji;
Server >> File:include/img/pic2.png:uwhewu(file)dhuw;


Sign In
Create Account


Back to top









