views:

937

answers:

1

I've been tinkering around with Flex RemoteObjects, and I've found that they aren't very well behaved with respect to timing out.

First, I can't figure out how to set a timeout on "connect". I know I can set requstTimeout, which will correctly timeout after an initial handshake… But if the server doesn't handshake, the connection doesn't time out (eg, the server accepts the connection, then does nothing with it, the client will just be left hanging).

Second, when a requestTimeout fires (timing out the request), Flex doesn't actually take any steps to tear down the connection – it just leaves it hanging there (no RST or the like). Clearly, this is more than a little bit undesirable. Is there any way to explicitly tear down the connection after the timeout?

I am using RemoteObject like this:

<RemoteObject id="foo" endpoint="http://bar" requestTimeout="42">
    <method … />
</RemoteObject>
+1  A: 

I believe you can listen for a faultEvent (That is triggered by the timeout) and have the connection killed in the handler.

Without diving into the source, I'm not sure how to set the connect timeout either.

CookieOfFortune
Thanks for the reply. I'm already listening for the fault event… But I can't figure out how, given a `FaultEvent` (or even the `RemoteObject` that caused it) to explicitly close the conneciton.
David Wolever
Also, I've found that when the other end times out (and sends a `FIN`), I *don't* get any sort of event…
David Wolever
RemoteObjects have a diconnect() function, I assume that will close the connection.Oh, and I think I found the connectTimeout. Look under the Channel and ChannelSet objects, they are accessible through the RemoteObject.Channel also happens to have a channelDisconnect event.I hope that answers everything.
CookieOfFortune