Hi,
I have an issue with WAListenerAdapter throwing ConnectionTimeOut and
ConnectionClosed exceptions in a headless image, which causes the VM
to abort. These "exceptions" are just socket timeouts, and can be
ignored.

The methods that I believe is the correct place to handle these is
coded as follows :-

waitForConnection: aSocket
        | socket stream |
        socket := aSocket waitForAcceptFor: 10.
        socket isNil ifTrue: [ ^ self ].
        stream := SocketStream on: socket.
        [ [ [ self process: stream ]
                ensure: [ stream close ] ]
                        ifCurtailed: [ socket destroy ] ]
                                forkAt: Processor userBackgroundPriority

I've changed the code so it looks like this :-

waitForConnection: aSocket
        | socket stream |
        socket := aSocket waitForAcceptFor: 10.
        socket isNil ifTrue: [ ^ self ].
        stream := SocketStream on: socket.
        [ [ [ [self process: stream ]
                on: NetworkError
                do:[:ex| ^self]]
                ensure: [ stream close ] ]
                        ifCurtailed: [ socket destroy ] ]
                                forkAt: Processor userBackgroundPriority

As the errors are intermittent and only occur on my production server,
I wonder is someone can look at the code, and tell me if I've added
the #on:do: block correctly.

Thanks.
-- 
~JT

Reply via email to