[REBOL] Re: problem with if error? try [block] [block]
From: compkarori:g:mail at: 19-Apr-2008 8:07
http://www.rebol.com/docs/core23/rebolcore-14.html#section-7
I'd wait on a port with a timeout value.
On Sat, Apr 19, 2008 at 7:28 AM, DougEdmunds <dougedmunds-gmail.com> wrote:
> Hello,
>
> I send a binary (bin_out) to a server (remote) which
> is supposed to send back a reply
>
> If the out-going binary is malformed, it causes the
> server to crash.
>
> The code below writes to a log when that happens.
> (The Rebol window and Rebol console always immediately
> after that).
>
> The problem is that I can't get the second part
> of the try statement (starting with [wait 2]
> to work, unless there has been at least
> one successful run-through of the first part
> (the 'wait remote' part).
>
> Is this a bug with try?
>
> -- Doug Edmunds
>
> ---start---
> ;(connection already opened)
>
> insert remote bin_out
>
> if error?
> try [wait remote]
> [wait 2
> print "Server crashed. See crash.txt"
> error_msg: reform [now {Server crashed} bin_out ]
> write/lines/append %crash.txt error_msg
> ]
>
> ;(get data from server)
> bin_in: copy remote []
>
> --- end---
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
Graham Chiu
http://www.synapsedirect.com
Synapse - the use from anywhere EMR.