Networking OSI (Open Systems Interconnection) model of computer networking, seven layers (the Application, Presentation, Session, Transport, Network, Data Link, and Physical Layers) TCP/IP (Transmission Control Protocol/Internet Protocol) UDP/IP (User Datagram Protocol) Connection model: connection-oriented and connectionless communication
TCP Socket Communications Listener Socket (Thread) Client Socket (Thread) Server Socket 1 (Thread) Server Socket 2 (Thread) Server Socket i (Thread) Server Client Connect Communicate Accept
TCP Sockets in Java SeverSocket server = new ServerSocket(12345, 3); Socket connection = server.accept(); ObjectInputStream input = new ObjectInputStream( connection.getInputStream() ); ObjectOutputStream output = new ObjectOutputStream( connection.getOutputStream() ); input.readObject() and output.writeObject(); output.close(); input.close(); connection.close(); Socket connection = new Socket( InetAddress.getByName( " " ), 12345) ObjectInputStream input = new ObjectInputStream( connection.getInputStream() ); ObjectOutputStream output = new ObjectOutputStream( connection.getOutputStream() ); input.readObject() and output.writeObject(); output.close(); input.close(); connection.close(); Server Client
An Example
Announcement No office hours today, Nov. 7.