CS158a
Chris Pollett
Feb. 2, 2009
Which of the following is most commonly used to connect several independent networks?
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);