Skip to main content

Series60 v3 HttpConnection.close

2 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Dan Ackroyd

On Wed, 24 Jan 2007 21:11:01 -0000, Chris B wrote:

> "Any open streams will cause the
> connection to be held open until they themselves are closed."
>
>Are you closing the stream(s) first?

Yes, all my opens are matched with closes for the HttpConnections,
inputstreams and outputstreams, but the error seems to only happen after
httpConnection.getResponseCode fails to return

As an aside it seems that the phone completely buffers the whole reading of
data from the server - i.e. normally when you download somethine you see
the data come in packets of hundreds->several k of bytes at a time. On both
the N91 and N70 is seems all 50k of data is passed to the J2ME level at
once, so there's a small chance that the phone itself is holding something
open.

cheers
Dan
Ack

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Chris B

public void close()
throws IOExceptionClose the connection.
When a connection has been closed, access to any of its methods that
involve an I/O operation will cause an IOException to be thrown. Closing an
already closed connection has no effect. Streams derived from the connection
may be open when method is called. Any open streams will cause the
connection to be held open until they themselves are closed. In this latter
case access to the open streams is permitted, but access to the connection
is not.

Are you closing the stream(s) first?

----- Original Message -----
From: "Dan Ackroyd"
To:
Sent: Wednesday, January 24, 2007 7:48 PM
Subject: Series60 v3 HttpConnection.close

> Hi,
>
> We've just found that on some series 60 devices that calling close on a
> HttpConnection will not return under some circumstances.
>
> The sequence of events are
>
> 1) Make connections, which work and return valid data and then are closed
> succesfully after being used.
>
> 2) Eventually (sometimes after just a few connections, sometimes after 15)
> one connection will not return a http response code - and so after 30
> seconds or so we decide to abort that connection attempt as it's probably
> not going to come back.
>
> 3) If you call HttpConnection.close() on the connection that hasn't
> returned that function call will not return.
>
> 4) All future attempts to open a HttpConnection will fail, whether or not
> you call close on the connection that failed.
>
>
> Any advice would really be appreciated as the project I've been working on
> is meant to be launching, er, yesteday.
>
> cheers
> Dan
> Ack
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".