A web address Resolver under 3.xx

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

Moderators: cheriff, TyRaNiD

Post Reply
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

A web address Resolver under 3.xx

Post by mypspdev »

Please I'm experiencing a loop out of which I do not see any exit...

Resolve is a good example well working under 1.50 using

sceNetResolverCreate(&rid, buf, sizeof(buf)
sceNetResolverStartNtoA(rid, RESOLVE_NAME, &addr, 2, 3)
sceNetResolverStartAtoN(rid, &addr, name, sizeof(name), 2, 3)

The startNtoA doen't work under 3.xx or I'm wrong.

I saw in some other sources that it's used

gethostbyname(RESOLVE_NAME)

but I've not yet been able to use it in place of previous ones.

Please any suggestion or help?

My final target is to retrieve a simple document from the web (a txt file) resolving the address.

I saw also this example

http://forums.ps2dev.org/viewtopic.php? ... ntcp#41426

still for 1.50 but it doesn't work for me neither under this fw kernel.

Thanks
User avatar
tacoSunday
Posts: 34
Joined: Fri Aug 31, 2007 10:05 pm

Post by tacoSunday »

If you want to save yourself many headaches, there is a psp port of libcurl floating around this forum. Libcurl is very powerful and easy to use. It takes care of resolving names and handling different protocols for you. All it really needs is wifi connected, url and a FILE pointer or custom IO function. It is also rather well documented.
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

Thanks for this suggestion.
I'll study it.

I saw libcurl under svn-pspdev even if not deeply investigated: there are amiga etc... makefiles but nothing for PSP, yet.

The example from your linkis still for 1.5 not for 3.xx:

I hope it could be adapted to 3.xxand I'll try to substitute

Code: Select all

sceUtilityLoadNetModule(1);
sceUtilityLoadNetModule(3);
instead of

Code: Select all

if((err = pspSdkInetInit()))
Please have you instructions about to compile the required libraries

-libcurl.a
-libpsp_req.a

for PSP ?
Thanks
User avatar
tacoSunday
Posts: 34
Joined: Fri Aug 31, 2007 10:05 pm

Post by tacoSunday »

The package I linked to is just a patch for the official 7.15.1 curl sources. the build process for the psp libs is hinky at best. There are pre-compiled binaries floating around out there somewhere in the aether.
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Post by mypspdev »

tacoSunday wrote:.......the aether.
Thanks very much.

What more tangible nowadays than aether....
In the past someone beleived that light was travelling through aether than others confirmed the empty space was its domain ....
what about web-sharing?
through empty space or through aether?

... in the aether... pardòn ... in http://svn.pspdev.org/listing.php?repna ... rev=0&sc=0
there is a readme.psp:

This is a port of libcurl 7.15.1 for the PSP, based originally on danzel's patches but
I have cleaned them up, in part because I added gethostbyname/addr to newlib itself.

To build configure the source with:

LDFLAGS="-L$(psp-config --psp-prefix)/lib -L$(psp-config --pspsdk-path)/lib" \
LIBS="-lc -lpspnet_inet -lpspnet_resolver -lpspuser" \
./configure --host=psp --disable-shared --prefix=$(psp-config --psp-prefix)

Then just:

make CFLAGS=-G0 && make install

TyRaNiD

I'm not so familiar with compiling instructions, but I'll try to intrepret these words.
User avatar
tacoSunday
Posts: 34
Joined: Fri Aug 31, 2007 10:05 pm

Post by tacoSunday »

Looks like the version you found on the svn is more recent than what I linked to (Duh). Definitely use it instead.

As for compilation, if your toolchain is set up correctly TyRaNiD's commands should go off without a hitch. It's not the hinky crap I had to go through :)

Best of luck on your endeavors.
Post Reply