Tuesday, August 4, 2020

Samples common files & code PART 2

In today's entry we are going to read about the net conexions and the ps vita (sockets). For that matter, we are using the Vita SDK documentation, network section.

This section gets into net modules on the vita, and its conections with everything related to sockets and HTTP.

Our project doesn't involve any of that, that is why this is a brief entry of the samples that cover this modules. If we need some of this code later we can go back and take a more deep aproach.

Note: the samples download the data in the ux0:data/ directory.


SAMPLE "socket_ping"

socket_ping: ICMP ping using raw sockets.

In its main.c you can read mostly about structs with the icmp datagrams and the ping data.

Note: These are to test if your connexion is active, and if the dns you are trying to connect is on (the sample use the google dns because is public, wide and "always" online). You can read more about this on their wikipedia pages: wikipedia icmp, wikipedia ping.


SAMPLE "net_http"

net_http: A minimal HTTP download sample.

In its main.c it shows how to load the module and download an html file from its web

Note: this is the basic function of a web browser.



SAMPLE "net_http_bsd"

net_http_bsd: A minimal HTTP download sample using BSD sockets.

This sample does the same as the net_http but using Berkeley Software Distribution Sockets. and shows the results on screen (the downloaded result generated a core dumped error to us tho).



SAMPLE "net_libcurl"

net_libcurl: A libcurl download sample.

Its main.cpp again shows how to load the module and use it to download a file from a webpage (specificaly the "vita_cord.vpk"), but this time use libcurl for the process.

Note: libcurl is a free and easy-to-use client-side URL transfer library.


-----------

Some screenshots from the samples running on the vita: 

And that's all for this entry.
net_http

net_http_bsd

net_libcurl



No comments:

Post a Comment