views:

327

answers:

1

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!

A: 

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

_serviceControl.requestTimeout = 1000;
Interesting...this didn't solve the problem for me at first, but when trying to test this I set the timeout to 5 seconds and I got a different error message - "The request timeout for the sent message was reached without receiving a response from the server." This means that the Flash call wasn't what was timing out, otherwise it would have given me this message in the first place. I tried setting the timeout in the PHP script (AGAIN) and now suddenly it seems to like it. Your response was still accurate and very useful to know, thank you!
Travesty3