Flex RemoteObject timeouts?

牧云@^-^@ 提交于 2019-12-13 00:41:11

问题


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:


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.



来源:https://stackoverflow.com/questions/1601404/flex-remoteobject-timeouts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!