×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    13

    HTTP is not making any connection after four attempts

    I am using HTTP connection to read some data from server.When i am using default emulators of NetBeans the application is running successfully with each time making new HTTP connection.
    But when i am using Nokia emulators or HTC Diamond(actual phone), i am able to make connections only 3-4 times not more than that.After four attempts HTTP is not making any connection. Please if anybody know than tell me the solution.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: HTTP is not making any connection after four attempts

    I would guess you are not closing the connections properly. There is a limit to how many simultaneous connections the implementation will allow you. You must close everything after you finish.

    PHP Code:
    HttpConnection con = (HttpConnectionConnector.open("http://...");
    try {
        
    InputStream in con.openInputStream();
        try {
            
    // process input
        
    finally {
            
    in.close();
        }
    finally {
        
    con.close();

    Using finally{} ensures that everything is closed even if an exception is thrown. You must close any Input and OutputStreams as well as the Connection itself.

    Cheers,
    Graham.

  3. #3
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: HTTP is not making any connection after four attempts

    what r u doing in code for connection? Please post ur code for connection. check whether u close the connections properly.
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. How to cancel a http connection mid-way
    By capricious28 in forum Mobile Java General
    Replies: 0
    Last Post: 2007-08-10, 10:42
  2. remote host address(of socket and http connection as well)
    By p_joon in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-05, 07:04
  3. Problem in Http Connection
    By jaceline in forum Mobile Java General
    Replies: 0
    Last Post: 2005-10-14, 04:08
  4. HTTP Connection issue
    By akhilss in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2005-09-12, 19:31
  5. Close HTTp Connection in N6230i
    By cars2004 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-06-24, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×