Le 21/05/2018 à 10:56, Hilaire a écrit :
Of course I already looked at this Test, but I got lost. I looked at it again, and wrote something like:

Sorry for the badly formated code.
By the way the exception handler does not work in the code version bellow. When the ConnectionTimedOut is raised the debugger still show up and the handler is not executed. Strange.

| socket data |
socket := Socket newUDP.
socket setPort: 9999.
socket waitForDataFor: 5 .
data := Array new: 100.
[[socket receiveUDPDataInto: data.
    data crLog] on: Error do:[ 'Error, closing socket' crLog. socket closeAndDestroy]]
ensure: [ 'Closing socket' crLog. socket closeAndDestroy].



--
Dr. Geo
http://drgeo.eu



Reply via email to