Flex - 增加 PHP 服务函数调用的超时

发布于 2024-08-26 21:21:53 字数 1352 浏览 2 评论 0原文

我正在使用 Flash Builder 4 Beta 2。我将其连接到 PHP 服务。我设置它的方式是使用向导,所以我实际上没有编写连接它的代码。该服务如下所示:

package services.flash
{
import mx.rpc.AsyncToken;
import com.adobe.fiber.core.model_internal;
import mx.rpc.AbstractOperation;
import valueObjects.CustomDatatype8;
import valueObjects.NewUsageData;
import mx.collections.ItemResponder;
import mx.rpc.remoting.RemoteObject; 
import mx.rpc.remoting.Operation;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.serializers.utility.TypeUtility;

[ExcludeClass]
internal class _Super_FLASH extends RemoteObjectServiceWrapper
{      

    // Constructor
    public function _Super_FLASH()
    {
        // initialize service control
        _serviceControl = new RemoteObject(); 

        var operations:Object = new Object();
        var operation:Operation;         

        operation = new Operation(null, "sendCommand");
         operation.resultType = Object;          
        operations["sendCommand"] = operation;

        ...
     }
}

我调用的函数之一从 MySQL 数据库获取用户。目前约有 30,000 名用户。当获取超过大约 22,000 行时,该服务似乎超时,我收到“在收到确认之前通道已断开连接”错误。但是,如果我从浏览器调用 PHP 脚本,它会毫无问题地获取所有这些脚本。我尝试增加 PHP 脚本中的超时(这不起作用),但显然这不是问题,因为浏览器能够毫无问题地拉起它们。

有没有办法增加Flash Builder中PHP服务的超时时间?我对 Flash 有点菜鸟,所以请描述一下。提前致谢!

I'm using Flash Builder 4 Beta 2. I have it connecting to a PHP service. The way I set this up was using the wizard, so I didn't actually write the code to connect to it. The service looks like this:

package services.flash
{
import mx.rpc.AsyncToken;
import com.adobe.fiber.core.model_internal;
import mx.rpc.AbstractOperation;
import valueObjects.CustomDatatype8;
import valueObjects.NewUsageData;
import mx.collections.ItemResponder;
import mx.rpc.remoting.RemoteObject; 
import mx.rpc.remoting.Operation;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.serializers.utility.TypeUtility;

[ExcludeClass]
internal class _Super_FLASH extends RemoteObjectServiceWrapper
{      

    // Constructor
    public function _Super_FLASH()
    {
        // initialize service control
        _serviceControl = new RemoteObject(); 

        var operations:Object = new Object();
        var operation:Operation;         

        operation = new Operation(null, "sendCommand");
         operation.resultType = Object;          
        operations["sendCommand"] = operation;

        ...
     }
}

One of the functions that I'm calling fetches users from a MySQL database. There are about 30,000 users right now. The service seems to timeout when fetching more than around 22,000 rows, I get the "Channel Disconnected before an acknowledgement was received" error. If I call the PHP script from a browser, it fetches them all with no problems at all, however. I have tried increasing the timeout in the PHP script (which didn't work), but obviously this isn't the problem since the browser is able to pull them up with no problems.

Is there a way to increase the timeout of the PHP service in Flash Builder? I'm a bit of a noob when it comes to Flash, so please be descriptive. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

穿越时光隧道 2024-09-02 21:21:53

所有远程对象都有一个 requestTimeout 参数。只需将其设置为所需的值即可。

_serviceControl.requestTimeout = 1000;

All remote objects have a requestTimeout parameter. Just set it to whatever is needed.

_serviceControl.requestTimeout = 1000;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文