Jump to content

Update server (using SDL_net)

- - - - -

  • Please log in to reply
No replies to this topic

#1
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
Hello!
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;
So can anyone see a possible issue or better way of doing this?
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users