Hi,

I have a situation where downloading lot of data results in
ConnectionClosed.

>>httpGet: urlString
    "Get the response from the given url"

    ^ [ ... .get: urlString ]
        on: ZnEntityTooLarge, ConnectionClosed
        do: [ : ex |
            ex isResumable
                ifTrue: [ ex resume ]
                ifFalse: [ self handleNonResumableConnection: ex ] ].

I read a mail from Sven you could change a global setting in
ZnNetworkingUtils as follows:

>>handleNonResumableConnection: anException

    | msg |
    msg :=  'We got a non-resumable exception while connecting to ' , self
url host asString , '. Re-try switching ZdcSocketStream to SocketStream?'.
    (self confirm: msg)
        ifTrue: [
            ZnNetworkingUtils default socketStreamClass: SocketStream.
            anException retry.]

But I would like to read about better handling, or recommendations.
What do you think?

Cheers,

Hernán

Reply via email to