lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Apr 30, 2012 at 12:23:46PM +0900, Miles Bader wrote:
> Peng Zhicheng <pengzhicheng1986@gmail.com> writes:
> >> I am using Lua to develop a mobile appication.
> >> Is there any function ( in lua sockets or other) to determine the
> >> speed of the device's internet connection?
> >>
> >> Or should I just download a file and calculate (bytes/time)
> >>
> >> I need to detect if the device's internet is 2G or not..
> >
> > I have not used Lua on mobile devices.
> > but at at least on Android devices, I know there is APIs to detect the
> > connection type.
> 
> Such functionality is very device- and OS-specific, so it's pretty
> unlikely a generic interface (like sockets) has it...

And in addition, only tells you the link's theoretical speed, not the
actual speed.  For example, a mobile 'phone on WiFi may notionally have
a 300Mbps link.  But it'd doubtful you'll actually get that speed on any
transfers, even ignoring things like other hops on the route between
device and remote server.

Measure the performance yourself. :)

B.