Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Sockets “A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port.

Similar presentations


Presentation on theme: "Introduction to Sockets “A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port."— Presentation transcript:

1 Introduction to Sockets “A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application to which data is destined to be sent.”

2

3 Networking Review TCP/IP Protocol Suite Application programming interface to TCP/IP (API) BSD Unix Java.net.Socket Platform Independence

4

5 Ports TCP and UDP use ports to map incoming data to a particular process running on the computer Ports are 16 bit numbers Need IP Address (32-bits) and port. 0-1023 Restricted out of 65,535.

6 Networking Classes in Java TCP: URL, URLConnection, Socket, ServerSocket UDP: DatagramPacket, DatagramSocket, MulticastSocket Socket and ServerSocket form two ends of communicaiton link.

7

8 Procedure Open a socket Open an input and output stream to the socket Read from and write to the stream according to the server’s protocol close streams close socket


Download ppt "Introduction to Sockets “A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port."

Similar presentations


Ads by Google