Description
Socket Overview
- Client/Server Model: A fundamental network architecture where a client requests a resource or service from a server.
- Reserved Sockets (Ports): Standardized port numbers (0-1023) reserved for specific applications and services, such as HTTP (port 80) and FTP (port 21).
- Proxy Servers: Intermediary servers that act as a gateway between a user’s computer and the internet, often used for security, privacy, or caching.
- Internet Addressing: The system used to identify devices on a network. The most common form is an IP address, which can be IPv4 (e.g., 192.168.1.1) or IPv6.
Java and the Net
- Networking Classes: Java provides a set of classes and interfaces in the
java.netpackage to facilitate network programming. InetAddress: Represents an Internet Protocol (IP) address.- Factory Methods: Static methods like
getByName()andgetAllByName()are used to createInetAddressobjects. - Instance Methods: Non-static methods like
getHostName()andgetHostAddress()retrieve information about the IP address.
- Factory Methods: Static methods like
TCP/IP and Datagrams
- TCP/IP Sockets:
Socket: A client-side class for creating a TCP connection to a server.ServerSocket: A server-side class that waits for and accepts incoming TCP connections from clients.
- Datagrams:
DatagramSocket: A class used for sending and receiving UDP packets.DatagramPacket: A class that represents a UDP packet, containing both data and addressing information.
URL Classes
URLClass: Represents a Uniform Resource Locator, providing methods to parse and access the components of a URL (protocol, hostname, port, file).URLConnectionClass: An abstract class used to represent a communication link to a URL, allowing you to read from and write to the resource identified by the URL.





Reviews
There are no reviews yet.