views:

365

answers:

2

I'm currently using AMFPHP 1.9 to make a simple flash game which uses a game server.

Sometimes, I get this error (BadVersion) when there are simultaneous calls to the server.

I've searched the web for some of the answers to this problem, and it seems they were answered back in 2004.

Is there an updated version of how to solve this problem?

I tried to change the globals.php parameters to use absolute path, like performing the below:

//$servicesPath = "services/";
//change to
$servicesPath = "/httpdocs/Flash/AMFPHP/services/";

but I cannot even go to the services browser when i changed it.

Updates: I managed to change to the correct path (by getting the path using a custom php which displays get_cwd())

So services browser is up now. However, i still get the timeout every now and then. (my request to the server is at about 5 mins interval)

I tried to spam querying to the server to determine if it was due to simultaneous calls, and realized it is not. (my local flash spams 30 X 3 requests / second and it work fine )

So now I suspect it might be due to timeout of the netconnection or something similar?

Update: Added keepalive call to server every 2 mins interval to see it it occur again. Webserver timeout seems to be set to 180 seconds.

A: 

Hi Jeffrey,

There was actually a new version released very recently (last 2 weeks) so definitely check that out to see if it helps.

I don't know your system (obviously) but I doubt that your absolute path there is correct, I would verify that, or set it back to the default. (It would probably start '/var/www/...' or similar)

I've leveraged amfphp on quite a few high traffic sites, and have never seen this error as a result of that, so definitely don't ignore other possibilities. Look carefully at the data your are sending/receiving for any possible errors there. Can it be encoded properly? Are their special characters, perhaps accent characters?

Try to narrow down the source of the error, is there one call that is always causing it? Perhaps try logging the results.

Goodluck!

Tyler Egeto
@Tyler Egeto: wow, I totally missed that release! Thanks for bringing the good news...
goliatone
Ya there are some new developers taking over the project so things are back in action, very nice to see!
Tyler Egeto
I think i found the answer, it was the wrong path.Now i need to stress test the simultaneous portion again.Was already using the latest 1.9 version from 2 weeks ago :)
Jeffrey Chee
Update: It still occur... now i need to look into the source files to double check...
Jeffrey Chee
I just added this line:$gateway->setLooseMode( true );hope its just this..
Jeffrey Chee
does mysql echo anything when error occur?my function does have mysql statements in it.basically its a simple select statement..
Jeffrey Chee
It depends on how it fails, if it's an sql error it will throw an actual Error. That BadVersion stuff is very cryptic (as in useless)
Tyler Egeto
I'm adding a keepalive call to the webserver every 2 mins, to see if it happens again. server timeout seems to be 180 seconds (from session_cache_expire() )..Does simply calling a dummy function that return 0 work? or do i need to call some php function to refresh?
Jeffrey Chee
no more bad version it seems. Or so I hope :)
Jeffrey Chee
Damn, it occur again. I'm stumped..
Jeffrey Chee
Were you just calling the "keep alive" method? Or general use?
Tyler Egeto
ya just calling it from the swf every 2 mins. the function does nothing on the server other than return 0.
Jeffrey Chee
If you have it in there, try leaving the "?>" off from the end of any PHP files, this can cause weird errors.
Tyler Egeto
Also make sure you don't have any strange characters (might be invisible), best way to do that is copy your code into notepad or similar, than into a new PHP file.
Tyler Egeto
I tried installing FoxyProxy and VisualProxy to monitor incoming and outgoing http traffic, and the BadVersion never occur.. Will keep trying.I've been calling the same server call every 5 mins interval, so maybe the "?>" should not be the main cause?
Jeffrey Chee
After disabling the FoxyProxy, and restarted the flash, I get the error almost immediately, and it wasn't even a simultaneous call (just the keepalive call).is there the possibility of it being a browser problem?
Jeffrey Chee
A: 

can you tell me how to make multiple simultaneous calls to the server??? help me!

Nguyen Manh Hung