• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Calulate net speed through applet

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to display the Internet speed in an applet. I tried using ping but its waste as ICMP is not supported by java, so how do I calculate the net speed in the applet???
Thank you in advance.
-Sid
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what is possible but you know that in the bottom windows task bar at the right corner it shows the icon (depends how you have it setup) that by pointing the mouse at does show the connection speed. Can you grab it somehow from the system?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the thing to do would be to mimic what ping is doing... Java supports UDP (java.net.DataGramSocket)... have the applet periodically send out numbered UDP packets then make a program to run on the server to listen for the UDP packets and send messages containing the UDP packet's number back to the applet when it recieves one. The applet will know is any packets are lost ( it will not recieve a response containing the UDP packet number from the server ), and it can use the difference in System.currentTimeMillis() calls to time how long it takes to recieve the reply. (Please don't ask for code to this... it is only a suggestion... )
HTH,
-Nate
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic