Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor mshita's Avatar
    Join Date
    Oct 2003
    Location
    Portland, OR
    Posts
    152
    Hi,

    I have an app that sends an HTTP request to a server. The server holds the connection open until some data is received from a remote device. The connection can be held open for up to 30 seconds. However, the user can choose to do something else during those 30 seconds. And if that happens, the HTTP connection needs to be closed.

    How can I kill an active http connection from a different thread?

    Any help would be appreciated.

  2. #2
    Registered User brilleaben's Avatar
    Join Date
    May 2003
    Posts
    32
    Well, you could send the

    Connection: Close

    string during the transmission. This should force the server to close the connection.

  3. #3
    Regular Contributor mshita's Avatar
    Join Date
    Oct 2003
    Location
    Portland, OR
    Posts
    152
    How do I do that?

  4. #4
    Registered User brilleaben's Avatar
    Join Date
    May 2003
    Posts
    32
    is.setRequestProperty("Connection", "Close");

    ... "is" is your previously opened inputstream.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved