gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Simple HTTP library

#83305 - EyeballKid - Mon May 15, 2006 6:24 am

Hi all,
I've written a simple HTTP library, I thought someone here might find it useful for integrating into DS apps.
I originally wrote it to help implement an online highscore table for a game of mine.

More information and download link here: http://www.scumways.com/happyhttp/happyhttp.html

It uses standard Berkley-style sockets - I seem to recall that there is some existing DS wifi code which has a sockets-compatability layer, so maybe it'll compile without too much trouble... Even if not, it'd be easy enough to replace the sockets code with something else.

Features:
  • Simple to integrate - just drop in the .h and .cpp files
  • Easy-to-use interface
  • Non-blocking operation, suitable for use in game update loops
  • Supports pipelining. You can issue multiple requests without waiting for responses.
  • Licensed under the zlib/libpng license.

Hope someone finds it useful!
(Selfish motive: I'm just hoping someone implements a launcher for booting homebrew apps from a web server :- )

#83393 - dexter0 - Tue May 16, 2006 2:36 am

Is this built on top of Stephen's WiFi Lib or did you write all the wifi code yourself?

#83416 - tepples - Tue May 16, 2006 5:17 am

It's built on top of BSD sockets, and EyeballKid just assumes that Stephen Stair's library has an API that resembles BSD sockets.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#83454 - Extreme Coder - Tue May 16, 2006 2:15 pm

tepples wrote:
It's built on top of BSD sockets, and EyeballKid just assumes that Stephen Stair's library has an API that resembles BSD sockets.

Which is correct,right?:D

I wonder how usable this is for WiFi games...:P

#83694 - EyeballKid - Wed May 17, 2006 10:06 pm

Extreme Coder wrote:
I wonder how usable this is for WiFi games...:P


Well, assuming the socket-emulation side of it is feasible, it should work fine for wifi games. It does use some C++isms that you wouldn't usually want to use on a small platform like the DS: some STL (used internally to store response headers, for example) and exceptions for error handling. But unless your game is _really_ suffering from memory fragmentation I don't think it'd be a big deal. And replacing that stuff with more vanilla C-like code wouldn't be too hard if it came to it.