Catching network down error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Catching network down error

Tomaz Nolêto
hi, I am trying to somehow get notified that connection has been lost
while downloading a file, so that  I can warn/prompt users about it. I
have noticed that by the time I shut connection down, OnDataAvailable
(from uriloader/exthandler/nsExternalHelperApp.cpp) is just not called
anymore, so certainly the problem is deeper than that. That is how deep
I got so far:

nsSocketInputStream::OnSocketReady
calls -> nsInputStreamPump::OnInputStreamReady
         calls -> cnsInputStreamPump::OnStateTransfer
                  calls -> ExternalAppHandler::OnDataAvailable ...

After shutting down the connection, none of them are any longer called.
Is there any error listener for that? How could I handle it in a
reasonable way?

--
Tomaz Nolêto
System Analyst
Open Source Mobile Research Center (OSMRC)
Instituto Nokia de Tecnologia (INdT)
[hidden email]
+55 92 2126-1115
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Catching network down error

Christian Biesinger
Tomaz Nolêto wrote:
> After shutting down the connection, none of them are any longer called.
> Is there any error listener for that? How could I handle it in a
> reasonable way?

OnStopRequest should be called in that case, with a failure status
code... is it?


--
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...]     --W. Shakespeare
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Catching network down error

Antonio Gomes (:tonikitoo)
hi :bi,

On 4/27/07, Christian Biesinger <[hidden email]> wrote:
>
> Tomaz Nolêto wrote:
> > After shutting down the connection, none of them are any longer called.
> > Is there any error listener for that? How could I handle it in a
> > reasonable way?
>
> OnStopRequest should be called in that case, with a failure status
> code... is it?


no it is not called.

we are working together on this =)

very similar to bug https://bugzilla.mozilla.org/show_bug.cgi?id=265828, but
we are running over the trunk, libxul, a modified minimal profile build.

ps: same on FF2.x and FF3.x

--
--Antonio Gomes
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Catching network down error

Christian Biesinger
Hi,

Antonio Gomes wrote:
> very similar to bug https://bugzilla.mozilla.org/show_bug.cgi?id=265828,
> but
> we are running over the trunk, libxul, a modified minimal profile build.

that bug is not about a lost network connection though. It is about
(basically) a timeout, as far as I can tell, except that Necko's HTTP
code never does timeouts. Therefore you are not notified about anything,
as the networking layer just assumes that there will be more data
eventually.


--
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...]     --W. Shakespeare
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Catching network down error

Antonio Gomes (:tonikitoo)
hummm, so a manually added timeout would do the trick , right ?! Anyways, if
it is not implemented yet so there might be a  reason/drawback ?

thanks

On 4/27/07, Christian Biesinger <[hidden email]> wrote:

>
> Hi,
>
> Antonio Gomes wrote:
> > very similar to bug https://bugzilla.mozilla.org/show_bug.cgi?id=265828,
> > but
> > we are running over the trunk, libxul, a modified minimal profile build.
>
> that bug is not about a lost network connection though. It is about
> (basically) a timeout, as far as I can tell, except that Necko's HTTP
> code never does timeouts. Therefore you are not notified about anything,
> as the networking layer just assumes that there will be more data
> eventually.
>
>
> --
> All the world's a stage,
> And all the men and women merely players:
> They have their exits and their entrances;
> And one man in his time plays many parts, [...]     --W. Shakespeare
>



--
--Antonio Gomes
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: Catching network down error

Christian Biesinger
Antonio Gomes wrote:
> hummm, so a manually added timeout would do the trick , right ?!

Yeah.

> Anyways, if
> it is not implemented yet so there might be a  reason/drawback ?

Well, the argument is, if something takes too long for the user they can
just click stop (or cancel, in the case of downloads). It _is_ possible
that the server is just slow.


--
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...]     --W. Shakespeare
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network