http://qs321.pair.com?node_id=114827

pitbull3000 has asked for the wisdom of the Perl Monks concerning the following question:

maybe this is a little bit off topic, but i asked me if it is possible to measure in some reliable way the connection speed during download between a server in the internet and a client at home. for example, like a status window how much of a file has already been downloaded and with which connection speed... maybe someone of all you noble men had the same question and solved it already...

Replies are listed 'Best First'.
Re: maybe OT, connection speed
by CubicSpline (Friar) on Sep 26, 2001 at 19:28 UTC
    This kind of depends on what you're asking for? Do you mean, is there a way to implement this yourself in your own client/server application architecure? Then 'Certainly!' If you mean hooking up this sort of functionality to some other application, or adding the capability to a client without having any control over the server, then I'd say 'I don't know.'

    When I've done this in the past, I have my servers response to a client begin with a preamble that includes the length, in bytes, of the response as a whole. Then all the client has to do is keep a running total of the number of bytes that have come in on the socket. HTTP does the same thing with the Content-Length header.

    HTH