CS158a
Chris Pollett
Feb. 2, 2011
import java.io.*; import java.net.*;
ServerSocket server = new ServerSocket(SERVERPORT); Socket socket;this might throw an exception if someone else is already bound to ServerPort.
socket = server.accept();which could be used to set up one connection with a client; typically, one would then spawn a thread.
Socket socket = new Socket("eniac.cs.sjsu.edu", SERVERPORT);
So we could define total latency as:
Latency = Propagation + Transmit + Queue Propagation = Distance/SpeedOfLight (will be different if looking at general propagation delay) Transmit = Size/Bandwidth
50 × 10^-3 × 45 × 10^6 bits/sec = 2.25 × 10^6 bits ≈ 280KB.
Throughput = TransferSize/TransferTime TransferTime = RTT + TransferSize/Bandwidth