0% found this document useful (0 votes)
1 views2 pages

Package

Uploaded by

punithagowrircs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Package

Uploaded by

punithagowrircs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit 1 – Java Networking

[Link] package

[Link] is a package that provides a set of classes as well as interfaces for networking in Java.
Some of the classes are URL class, URLConnection class, Socket class, ServerSocket
class, DatagramSocket, MulticastSocket etc.
[Link] package classes

DatagramPacket
The DatagramPacket class is used to provide a facility for the connectionless transfer of
messages from one system to another. This class provides tools for the production of datagram
packets for connectionless transmission by applying the datagram socket class.

InetAddress
The InetAddress class is used to provide methods to get the IP address of any hostname. An IP
address is expressed by a 32-bit or 128-bit unsigned number. InetAddress can handle both IPv4
and IPv6 addresses.
ServerSocket

The ServerSocket class is used for implementing system-independent implementation of the


server-side of a client/server Socket Connection. The constructor for ServerSocket class throws
an exception if it can’t listen on the specified port.

Socket

The Socket class is used to create socket objects that help the users in implementing all
fundamental socket operations. The users can implement various networking actions such as
sending, reading data, and closing connections

DatagramSocket

The DatagramSocket class is a network socket that provides a connection-less point for sending
and receiving packets. Every packet sent from a datagram socket is individually routed and
delivered. It can further be practiced for transmitting and accepting broadcast information.
Datagram Sockets is Java’s mechanism for providing network communication via UDP instead
of TCP.

URL

The URL class in Java is the entry point to any available sources on the internet. A Class URL
describes a Uniform Resource Locator, which is a signal to a “resource” on the World Wide
Web. A source can denote a simple file or directory, or it can indicate a more difficult object,
such as a query to a database or a search engine.

URLConnection

The URLConnection class in Java is an abstract class describing a connection of a resource as


defined by a similar URL. The URLConnection class is used for assisting two distinct yet
interrelated purposes. Firstly it provides control on interaction with a server(especially an
HTTP server) than a URL class. Furthermore, with a URLConnection, a user can verify the
header transferred by the server and can react consequently. A user can also configure header
fields used in client requests using URLConnection.

You might also like