CORE API / NOTES</>↗Core API31 Mar 2025
You can use Java’s InetAddress class to check internet connectivity and ping a server directly. Here is how you can do it: Steps to check internet connectivity and ping a server: Use InetAddress.getByName(String host) or InetAddress.getByAddress(…) to get the address of the host/server you want to ping. Use the isReachable(int timeout) method to test if […]
CORE API / NOTES</>↗Core API30 Mar 2025
In Java, you can use the URLEncoder and URLDecoder classes to handle URL encoding and decoding. These classes are part of the java.net package and are often used to ensure that special characters in URLs are properly encoded so they can be safely transmitted over the web. For decoding, you can convert encoded URLs back […]
CORE API / NOTES</>↗Core API29 Mar 2025
In Java, the CookieManager and CookieHandler classes from the java.net package are used for handling HTTP cookies. They allow you to manage cookies for actions such as sending cookies with HTTP requests or maintaining sessions between HTTP communications. Steps to Use CookieManager and CookieHandler Set a Global CookieManager: The CookieHandler class is an abstract class, […]
CORE API / NOTES</>↗Core API28 Mar 2025
To implement secure socket communication using SSLSocket and SSLServerSocket in Java, you need to utilize the Java Secure Sockets Extension (JSSE) API, which provides support for the SSL/TLS protocols. Below is a step-by-step guide: 1. Key Concepts SSL/TLS provides encryption and ensures secure communication between a client and server. You need: A keystore on the […]
CORE API / NOTES</>↗Core API27 Mar 2025
In Java, multicast communication is performed using the MulticastSocket class, which provides the ability to send and receive data packets to and from a group of interested processes (also referred to as a multicast group). Below is a brief explanation and an example of how you can achieve this: Steps for Multicasting Communication with MulticastSocket […]
CORE API / NOTES</>↗Core API26 Mar 2025
In Java, the Proxy class (available in the java.net package) allows you to configure and use HTTP or SOCKS proxies when making network connections. With this class, you can control the routing of requests through a proxy server. Here’s an explanation and examples of how to use the Proxy class for both HTTP and SOCKS […]