Flex RemoteObject 超时? [英] Flex RemoteObject timeouts?

查看:18
本文介绍了Flex RemoteObject 超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在修补 Flex RemoteObjects,我发现它们在超时方面表现不佳.

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

首先,我不知道如何在连接"上设置超时.我知道我可以设置 requstTimeout,它会在初始握手后正确超时……但是如果服务器不握手,连接不会超时(例如,服务器接受连接,然后什么都没有,客户端将被挂起).

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).

其次,当 requestTimeout 触发(请求超时)时,Flex 实际上并没有采取任何措施来断开连接——它只是让它挂在那里(没有 RST 或类似).显然,这有点不可取.有没有什么方法可以在超时后显式断开连接?

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?

我正在像这样使用 RemoteObject:

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

推荐答案

我相信你可以监听一个 faultEvent(由超时触发)并在处理程序中终止连接.

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.

这篇关于Flex RemoteObject 超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆