cancel
Showing results for 
Search instead for 
Did you mean: 

how to find network band width

Former Member
0 Kudos

hi,

java Gurus

can u pls tell me how to find network bandwidth

regards

Guru

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

good

you need to set up a connection using java.net.Socket and java.net.ServerSocket to another computer and transfer a large known amount of data at a time when the network is known to be quiescent and measure the time taken. Then bandwidth = bytes per second, or bits per second depending on what you want. You also need to take care that your sending and receiving code is optimal, which is mostly a matter of large socket send and receive buffers and local buffers in your code.

thanks

mrutyun

0 Kudos

Hi,

you can monitor server throughput using netstat -e (on a windows box).... If you wnat that in your application try somthing like this:

Runtime rt=Runtime.getRuntime();

Process p=rt.exec("C:
command /c netstat -e");

p.waitFor();

System.out.println("process"+p.exitValue());

-Roger