1 / 6

Networking with Sockets

Java's networking capabilities, defined in the packages and interfaces of java.net, enable applications to engage in both stream-based and packet-based communications. Stream sockets (TCP) facilitate continuous data flow between processes, while datagram sockets (UDP) support connectionless communication for individual packets. This guide covers the client/server model, demonstrating how clients initiate requests and servers respond, exemplified by browsers communicating with web servers. We explore socket types, including connection-oriented TCP and connectionless UDP, crucial for networking applications.

nanji
Download Presentation

Networking with Sockets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Networking with Sockets

  2. Java Networking • Java’s networking capabilities are declared by the classes and interfaces of package java.net, through which Java offers stream-based communications that enable applications to view networking as streams of data. • The classes and interfaces of package java.net also offer packet-based communications for transmitting individual packets of information—commonly used to transmit data images, audio and video over the Internet.

  3. client/server relationship • The client requests that some action be performed, and the server performs the action and responds to the client. A common implementation of the request-response model is between web browsers and web servers. When a user selects a website to browse through a browser (the client application), • a request is sent to the appropriate web server (the server application). The server normally responds to the client by sending an appropriate web page to be rendered by the browser.

  4. A Stream socket A process establishes a connection to another process. While the Connection is in place, data flows between the processes in continuous streams

  5. A socket address  Is the combination of an IP address and a port number, much like one end of a telephone connection is the combination of a phone number and a particular extension. Based on this address, internet sockets deliver incoming data packets to the appropriate application process

  6. 1-Datagramsocket (UDP) also known as connectionless sockets, which use UserDatagram protocol (UDP). 2-Stream socket (TCP) also known as connection-oriented sockets, which use Transmission control protocol(TCP) or Stream control Transmission protocol(SCTP). :Socket types

More Related