HttpURLConnection Disconnect() Example

Indicates that other requests to the server are unlikely in the near future.


HttpURLConnectionclass Disconnect() method example. This example shows you how to use Disconnect() method.This method Indicates that other requests to the server are unlikely in the near future.

Here is the code:-
/* 
 * @Program that Indicates that other requests to the server are unlikely in 
    the near future.
 * Disconnect.java 
 * Author:-RoseIndia Team
 * Date:-25-Jun-2008
 */

import java.net.*;
public class Disconnect {
 public static void main(String[] argsthrows Exception {
        URL url = new URL("http://192.168.10.211:8080");
        HttpURLConnection connection = (HttpURLConnectionurl.openConnection();
        connection.disconnect();
 // Indicates that other requests to the server are unlikely in the near future.
        System.out.println("Connection disconnected");
    }

}

Output of the program:-
 Connection disconnected

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US