Here, we are going to explore a method to retrieve the IPAddress of the local system in a very simple example. For this, we use getByName() method of InetAddress class to create a object that contains IP address for the given host name.
In this section, you will show the used of several method for different output massage. Here, we provide a complete example based on the method for creating the Socket() method. Firstly create a class named of "getKeepAlive" and initialize a class Socket
Here we are going to explain the method to find out the URL information. This program defines the IOException for the exception handling. This exception is thrown to indicate an I/O problem.
In this section, you will learn how to get content-length, content- type, and last-modify date of a file. Here we provide a complete example that uses getHeaderFieldKey() method. Firstly create a class GetHTTPHeader and initialize a class URLConnection. T
This is a simple program of java network and supports the java.net package. Here, we have defined the class named EncoderTest.java. This class contains static methods for converting a String to the application-urlencoded MIME format.
In this section, we are going to explain the method to find out the hostname port number of a local machine. This program defines the IOException for the exception handling. This exception is thrown to indicate an I/O problem in the program.
Client Socket Information
In this section, you will learn how to get client socket information. This is a very simple program of java network. Here, we have used the class named ClientSocketInformation.java that implement the constructor of the Socket class passing two arguments a
What are Chained Exceptions?
Whenever in a program the first exception causes an another exception, that is termed as Chained Exception. Java provides new functionality for chaining exceptions.