Download presentation
Presentation is loading. Please wait.
Published byMargery Barker Modified over 8 years ago
1
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
2
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
3
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( "127.0.0.1" ), 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
4
An Example
5
Announcement No office hours today, Nov. 7.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.