Forum Multiplayer Detecting internet connection/server online

Discussion and help relating to the PlayerIO Multiplayer API.

Detecting internet connection/server online

Postby nulllgames » March 16th, 2011, 6:03 pm

I've come across a problem several times now that i can't seem to track down. I happens very rarely but leaves no feedback. I managed to reproduce the error (at least i'm fairly certain that i've found the cause).

When players enter the multiplayer part of the game they'll be connected to player.io and while the game waits for any server response, there will be a waiting bar animating.
On a few occasions this takes a long time (30 seconds at a guess) and then it just crashes. The problem is that the flash debugger doesn't catch the error, instead i get a windows popup that says : an error happened in Flash Player 10.1 r53 and must be closed.

This happens (i think) when the server is somehow not capable of responding at all. About an hour or so ago it happened again, and when i visted the playerio site, i got a "HTTP Error 503 - Service unavailable". This 503 error is the only time i see a link between playerio and the error however, so it could not be related at all.

As a test, i commented out the actual connection code, so the animated waiting bar waits endlessly, this produces no error.
But when i unplug the network cable, i get the same error again (immediately when the connect is attempted). Now chances are people won't be able to load the flash game to begin with if there's no internet connection, but other factors could come into play here. Is there a sure way to test that the server is online (internet connection doesn't mean automatically the server can be reached), before or during the connection attempt?
I also tried some of the examples from the playerio site and they also throw this error when my pc is not connected to the internet.
http://nulll-void.com/games/ - scifi themed flash games
User avatar
nulllgames
 
Posts: 10
Joined: January 25th, 2011, 9:41 pm

Re: Detecting internet connection/server online

Postby flexcool354 » March 16th, 2011, 8:38 pm

Maybe it's an infinite loop, flash is supposed to end them automatically, but I've experienced many times that crashed flash

What is your code doing at the point where you get the error?
Last edited by flexcool354 on March 16th, 2011, 10:28 pm, edited 1 time in total.
flexcool354
 
Posts: 35
Joined: September 26th, 2010, 5:31 pm

Re: Detecting internet connection/server online

Postby nulllgames » March 16th, 2011, 9:51 pm

I tried that, i removed the code that connects to the server, so the game will sit waiting indefinately for any kind of server response and in that case it just keeps running nicely without any problems for however long i want it to.

All the code is doing is updating an animation while listening for a certain variable to be set to a certain value. This variable only changes in either the callback function or errorhandler function that are fired from the usual connect command.
So in the above test, the variable remains at it initialized value and the game keeps on waiting.
http://nulll-void.com/games/ - scifi themed flash games
User avatar
nulllgames
 
Posts: 10
Joined: January 25th, 2011, 9:41 pm

Re: Detecting internet connection/server online

Postby Oliver » March 18th, 2011, 11:01 am

Hey,

Player.IO is a distributed system with many different servers and components acting together as a whole unified system. Once in a while one of those servers/software might have issues that will affect some users, but most likely only a small selection of users and only for a short while (there are failover systems in place that take over when issues pop up).

I might well be that the flash api does not handle "no internet connection" very well.

Can you give me the exact steps you use to create the error? Do you call connect() while online and then pull the cable and then try calling createJoinRoom() or ?

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Detecting internet connection/server online

Postby nulllgames » March 18th, 2011, 12:17 pm

I have no problem with the possibility of network troubles, my main concern is to catch this error and give the player a proper error message. Assuming the problem is not related to my code, which might as well be.

Right now i can reproduce it easily with FridgeMagnets, if i launch it from within flash CS4 (debug mode), when my network cable is unplugged i get a windows error message, regarding an error in Flash Player 10.0 r2. Flash debugger itself never catches an error.
If i launch the published swf outside of flash cs4 i get the same error.
If i use the html file that came with the publish, the game does report 'unable to connect' as expected while in chrome.
Same deal with TicTacToe.

In Firefox, both my game and FridgeMagnets are stuck at the connecting part, neither is returning an error in Firefox, but it works ok in Chrome, where both games immediately tell me they can't connect when cable is unplugged.
I think this is the confusion i ran into earlier - i use both Chrome and Firefox to test games and they behave differently on this matter.

With this i'm sure it happens at the time of the connect code and not with the roomlist.

In my game i call connect the moment players click a button to go to the multiplayer area, the roomlist is inside the callback function for a successfull connect.

I get the same behaviour from my game with cable unplugged : when the connect is called, i get the windows error, but in a browser the error is caught and player is notified.

Another test : i launch the game, connect and get a roomlist. Then i unplug the network cable and ask for a new roomlist - i get the windows error.
In a browser (both Chrome/FF this time) the behaviour is different - if i ask for a roomlist after unplugging, the game appears to wait indefinately for the list and my errorhandler is never called. I can't test this properly (i have a trace that tells me when its called as well as a message in game) in debug mode since the only way to simulate server trouble at this point is to unplug the network cable, which crashes the flash player.

So if there's network trouble preventing a player from connecting to the server (or getting roomlist), it appears they'll be told so in Chrome, but not in Firefox. What i can do is set a timer and if there's no response at all from the server i can tell players to try again in a few moments. But in the background i think the game is still waiting for a connection, since it's never properly cancelled (i assume). Is there a sure way to cancel a connect or roomlist in progress?

Code: Select all
PlayerIO.connect(StageRef, "xxx", "public", PlrUName, "", handleConnect, handleError);
         
function handleConnect(client:Client):void{
   trace("Sucessfully connected to player.io");
   ClientRef = client;
   // get list of rooms
   RoomList();
}

function handleError(error:PlayerIOError):void{
   trace("Got error trying to connect : ", error)
}

RoomList():void {
   ClientRef.multiplayer.listRooms("HDduel", { }, 96, 0, funcRoom, funcError);

   function funcRoom(rooms:Array) {
      // turns roomdata & names into visuals for the player
   }

   function funcError(error:PlayerIOError) {
      Updates.UpdatePopup("Error : unable to list rooms, try again in a while.");
      trace("Unable to list rooms : ", error);
   }
}
http://nulll-void.com/games/ - scifi themed flash games
User avatar
nulllgames
 
Posts: 10
Joined: January 25th, 2011, 9:41 pm

Re: Detecting internet connection/server online

Postby Oliver » March 21st, 2011, 5:27 am

Hey,

Thanks for the very detailed report, much appreciated.

I've escalated the issue to the guy in charge of the actionscript client, to see if we can catch this issue in the client and return a nice error in the error callback.

Will report back when i've heard from him.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Detecting internet connection/server online

Postby womoxey683 » January 19th, 2022, 10:02 am

How can I set mywifiext setup?
1. Connect Extender to Power Outlet and then to Computer?
2. If you are linking to Ethernet links, make sure they are securely connected at this stage.
3. Check that the green light on the extender turns on when you turn it on.
4. Once the extender is ready you can now start a new web browser on your machine.
5. In the address bar of the software, type http://mywifiext.net.
womoxey683
 
Posts: 3
Joined: January 19th, 2022, 7:52 am

Re: Detecting internet connection/server online

Postby salo » April 18th, 2022, 9:02 am

womoxey683 wrote:How can I set mywifiext setup?
1. Connect Extender to Power Outlet and then to Computer?
2. If you are linking to Ethernet links, make sure they are securely connected at this stage.
3. Check that the green light on the extender turns on when you turn it on.
4. Once the extender is ready you can now start a new web browser on your machine.
5. In the address bar of the software, type http://mywifiext.net.
Hotstar apk has revolutionized the traditional way of watching TV into an advanced way to enjoy watching TV anytime, anywhere. It is one of the biggest online video streaming platforms where you can enjoy watching your favorite new and old TV shows, serials, news, sports, and movies.
hotstar-mod-apk
salo
 
Posts: 7
Joined: April 18th, 2022, 8:46 am


Return to Multiplayer



cron