Retrieve files via http

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

planetusa
Posts: 21
Joined: Tue Dec 06, 2005 3:03 pm
Location: Asheville
Contact:

Post by planetusa »

On the quitting problem, you ALSO need to turn off wifi, else it has problems turning it on the next time.

On the other issue, having never used curl, I went to take a look.

Looks like if you don't use a callback, it can write to a file, this is good news indeed.

Now to define the appropriate functions.

Michael
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

Yeah it comes with a built in way to save files to a filehandle.
http://curl.haxx.se/lxr/source/docs/exa ... pheaders.c uses it to save the headers.

Examples are here: http://curl.haxx.se/libcurl/c/example.html incase you haven't seen them.
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

toolchain install error, compile error

Post by dbeyer3069 »

I have not been able to get the wlan example working that was posted in this forum. Installing the latest toolchain gives me an error about netinet/in.h being missing (not in my path) and even If I move files to get around that, I get the same exact error as PSPFAN.

Is anyone else getting this?

If it's working for you...please post your exact makefile and PSPSDK pathing info please.

I have reinstalled cygwin and the toolchain FRESH twice this weekend with no luck (doing it now for a third time). I can compile my application and run it otherwise...but programs using the netinet are giving me real grief.

David Beyer
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

You need to do a cvs checkout of the latest psp toolchain, as you will probally be using the old newlib patch which didn't contain this file.

Code: Select all

svn checkout svn://svn.pspdev.org/psp/trunk/psptoolchain
cd psptoolchain
./toolchain.sh
You can copy the .tar.bz2/gz of the newlib/gcc/binutils/gdb source files into the psptoolchain folder before running ./toolchain.sh to save on downloading them again if they are the same version.
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

danzel wrote:You need to do a cvs checkout of the latest psp toolchain, as you will probally be using the old newlib patch which didn't contain this file.

Code: Select all

svn checkout svn://svn.pspdev.org/psp/trunk/psptoolchain
cd psptoolchain
./toolchain.sh
You can copy the .tar.bz2/gz of the newlib/gcc/binutils/gdb source files into the psptoolchain folder before running ./toolchain.sh to save on downloading them again if they are the same version.
Strangely enough.. I tried this and had the same result. What I did was go to the oopo site and download the toolchain tar from there and install that... and that took (don't ask me why). Everything is working and compiling fine now. I woke up this morning and did a DAMN! It worked. Took 3 tries.

Thanks for the help. I'm trying to the curl stuff now.

Anyone tried it yet in a real app? (besides the original poster)?

David Beyer
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

blocking vs. nonblocking

Post by dbeyer3069 »

I've noticed a lot of libraries coming out for WLAN and transfers are using blocking mode for a lot of their calls. Are there PSP issues with running non-blocking code in background threads (or main thread) that I'm not aware of? In some cases (like interactive games), blocking simply isn't going to work.

David Beyer
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

Good to hear you got it going.

I'm using non blocking waits with multiple threads in peldet (irc and telnet client) and I don't have any trouble with it.
I haven't made anything using libcurl yet, I have something in mind though ;)
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

danzel wrote:Good to hear you got it going.

I'm using non blocking waits with multiple threads in peldet (irc and telnet client) and I don't have any trouble with it.
I haven't made anything using libcurl yet, I have something in mind though ;)
I made good progress today. I got my app running with WLAN code as follows:

The main app's main thread is created in KERNEL mode;
it spawns a USER mode main thread;
it spawns a USER mode WLAN background thread;

Had a little problem but then I backed down the stack size of the second spawned user thread and it then worked.

###

I need to see what the differences are in how you do ADHOC vs. INFRASTRUCTURE mode access. I am trying to figure out the best way to exchange data with other WIFI players (I will probably pass it through my web site server). Ideas on this is welcome.

David Beyer
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

You call a different set of functions to do an adhoc connection, and I don't think these have been properly documented yet. (have a search around)

However, I seem to recall someone saying that if the two psps are set up with infrastructure connections that have the same SSID then they can create some sort of infrastructure connection between themselves, if you search around you may be able to find the thread, I don't think there was much in it though.
I don't have a 2nd psp to test, but if you do then have a play with it :)

If both psps can connect to the same infrastructure then you would be able to send a file directly between them over a tcp socket (through the wifi AP of course).
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

danzel wrote:You call a different set of functions to do an adhoc connection, and I don't think these have been properly documented yet. (have a search around)

However, I seem to recall someone saying that if the two psps are set up with infrastructure connections that have the same SSID then they can create some sort of infrastructure connection between themselves, if you search around you may be able to find the thread, I don't think there was much in it though.
I don't have a 2nd psp to test, but if you do then have a play with it :)

If both psps can connect to the same infrastructure then you would be able to send a file directly between them over a tcp socket (through the wifi AP of course).
In all likelyhood, few of my game players would be in close proximity to each other for an ADHOC connection but I'd probably like to support it anyways.

I have to exchange potentially large amounts of varied data between users (location, profiles, etc.) so it will be interesting to see how all this works out.

David Beyer
User avatar
pailes
Posts: 16
Joined: Fri Feb 16, 2007 4:31 am
Contact:

Post by pailes »

Hey this is really nice. Can we use this code freely for our own purpose?
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

pailes wrote:Hey this is really nice. Can we use this code freely for our own purpose?
Yes.. feel free. I no longer develop for the PSP (at least for now).

David Beyer
Post Reply