Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Android Player: Failed to listen on port 5687, this socket is already listening on 0 (or 5687)

Author
Message
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Apr 2013 14:37 Edited at: 5th Apr 2013 08:45
Hey all,

I'm currently using the BETA8 version of AppGameKit, and in order to test out a prototype quickly on Android I downloaded the latest player (BETA9) from Google Play, hoping it would work fine with the BETA8 AppGameKit as it says, "Requires the AppGameKit IDE to send apps, available for purchase here http://www.appgamekit.com with version 1061 or greater."

However, when I start the player my Nexus 7 that is connected to a local wifi and broadcast my program, it almost always gives me the error, "Failed to listen on port 5687, this socket is already listening on port 0". After the first try it often says "port 5687" in both places (rather than "port 0"). Sometimes it says the "port 0" version immediately when starting the player.

Now, it's not the network because before downloading the BETA9 player, I tried broadcasting my program and it worked perfectly. I couldn't remember whether I'd updated to the latest player yet, so I worked with that player for a while and it worked until I started using some of the newer commands in my code, which of course made the player complain of unrecognised commands.

OCCASIONALLY, the program will actually succeed in broadcasting to the Nexus, but doesn't always work correctly when it does. What on earth is going on here?

So I updated and it gets this stupid error every time. Please don't just tell me to update AppGameKit to BETA9 because I can't just yet. I live in country Australia and have limited satellite internet (it's actually not too bad but I've used up my download quota for this month...well last month, it resets tonight).

EDIT: It occurred to me that it's likely not the relationship between BETA8 AppGameKit and BETA9 Player because that error often pops up even without broadcasting an app.......although as far as I know it only occurs immediately on startup if the error has occurred previously during broadcast, so maybe it is indeed related to the BETA8/BETA9 thing...

Now I have work to do on CubeScape

Thanks in advance! (Does anyone hate it when people say that? )

Clonkex

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Apr 2013 16:36
Whenever I have a Player get hung up like that it is usually necessary to power cycle my device to reset everything. Sometimes force stopping the Player on an Android device works, but not always.

I don't know what causes it to act up like that.

I have noticed that, sometimes, the AppGameKit IDE keeps rebroadcasting the app until you hit the red x. That might be the actual culprit.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 1st Apr 2013 17:11
Whenever I get player errors I can usually fix that by recompiling the game. Or if that doesn't work I just restart the player. Never had a problem lasting a restart of the app.


Demo 3 is out now!
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 1st Apr 2013 18:48
I get this occasionally as well and a reboot of the Android device and AppGameKit IDE seems to fix it.
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 2nd Apr 2013 01:10
I hate it when I forget to mention that I've already completed the obvious because then everyone wastes their time telling me to do the obvious. I've tried restarting everything multiple times. Turning on and off the Wi-Fi on the device or restarting it or even just waiting a while makes the player start properly but I still can't broadcast. Anyway last night I started downloading beta 9 of agk to see if that's the problem. It took 9 hours to download at 5KB/s. I haven't tested that yet so wish me luck.

Thanks for the answers....actually they may have given me an idea. Also I can't just click the red x because some time ago (about a month after buying the agk, which was as soon as it was released) I pressed something whilst trying to open the Manager (it was somewhere around the f2 key) and the compile toolbar disappeared and since then I haven't been able to get it back, no matter what I do. So I have to rely on opening and closing the compile menu option repeatedly to see when the compile has finished.....it's stupid but nothing I do can make the toolbar come back.

Clonkex

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Apr 2013 01:26
Click on View > Toolbars > Compiler and it will (should) reappear.
Shift + F2 shows/hides the Projects Panel.
F2 Shows/Hides the Compile Logs panel.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Apr 2013 08:01
I had all sorts of issues with the IDE today (my fault) and was only able to restore the Compiler toolbar by changing the view to AppGameKit Default, in case Mobiius' fix doesn't work for you.

Also in the Build menu you could click the X to abort broadcasting.
It really sounds to me like it is some weird issue with the new player and the older IDE.

If you don't have the bandwidth to get the new 1089 compiler, then maybe the attached AppGameKit player for 1088 will help? It is much smaller at 3.5MB.
Hope this helps!

Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Apr 2013 15:00
Even though it is theoretically possible to broadcast from an older IDE to a newer Player, I wouldn't expect it to work properly.

All it takes is for the byte code build to have changed how many bytes are allocated for something at start up and the IDE and Player are no longer talking the same language. (I once went through the Player code for processing the byte code file in great detail trying to understand something.)

And here is another link for several of the Players.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Apr 2013 18:28
Would be great if TGC would host those files and make them readily accessible by everyone. I remember how frustrated I was when I started off and couldn't find the player I needed!

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 5th Apr 2013 10:25 Edited at: 5th Apr 2013 11:39
Quote: "Click on View > Toolbars > Compiler and it will (should) reappear."


Lol no way I've tried that so many times.

Quote: "Shift + F2 shows/hides the Projects Panel.
F2 Shows/Hides the Compile Logs panel."


I know but I simply cannot find what I pressed to make the compile toolbar disappear!

Quote: "I had all sorts of issues with the IDE today (my fault) and was only able to restore the Compiler toolbar by changing the view to AppGameKit Default, in case Mobiius' fix doesn't work for you."


Ah, yes, that's what I did to begin with, but I managed to press whatever it I press and broke the AppGameKit Default view as well. AND AppGameKit Minimal. TGC really needs to do something about this.

Quote: "If you don't have the bandwidth to get the new 1089 compiler, then maybe the attached AppGameKit player for 1088 will help? It is much smaller at 3.5MB."


Thanks, but I managed to download AppGameKit Beta9 And yes, the error still occurs, although I have figured out how to make it work and I have a fairly decent theory as to why this happens.

If it starts happening, I have to either restart my device or turn off wifi and wait for a couple of minutes. To prevent it from happening, I have to be very careful about how I exit my apps during testing. If I just press Home or kill the app from Recent Apps like I should be able to do, the error will appear next time I start the player. If I hold for five seconds at the top of the screen to kill the app and then press power button to close the player, it will work (so far reliably).

My theory is that the player opens a socket to listen for the IDE's broadcasting messages, and the error is caused when the player tries to open the socket again and the socket hasn't been closed. When you close the app by holding at the top for 5 seconds, the player closes the socket properly. Also, if you restart the device or turn off wifi for a length of time the socket is closed. However, if you kill the player, the socket is not closed and the error occurs next time you start the player.

My theory is backed up by another error I got only one time. I had worked out that normally closing the app makes the error stay away, so I closed the app by holding at the top of the screen, and the player said something about failing to close the socket. Next time I started the player it got the failed to listen error.

Quote: "Would be great if TGC would host those files and make them readily accessible by everyone. I remember how frustrated I was when I started off and couldn't find the player I needed!"


Definitely!

Clonkex

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 5th Apr 2013 20:36
This doesn't happen for me on my Nexus 7 with 1089.
Is it your own player that you built or the one TGC built?

If you have access to another computer on a different wifi router can you test there? I'm a little suspicious of the router.

Another thing you might want to try is giving your Nexus a static IP on your wifi network. I have an app, Tablet Talk, that has a tough time listening on a port when the devices to connect don't have static IPs.

Good luck, this sounds pretty annoying.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 6th Apr 2013 15:56
Quote: "Is it your own player that you built or the one TGC built?"


Downloaded direct from Google Play.

Quote: "If you have access to another computer on a different wifi router can you test there?"


I do have another computer and another router; I'll test it sometime when I get a chance.

Quote: "I'm a little suspicious of the router."


You are right to be suspicious. It's a Netgear MR314 from 2001. I know it's ancient but I needed a cheap wireless router. And it's solid metal. I like metal-cased devices. Luckily the other router I can use is a much more recent one (2011?).

Quote: "Another thing you might want to try is giving your Nexus a static IP on your wifi network. I have an app, Tablet Talk, that has a tough time listening on a port when the devices to connect don't have static IPs."


I'll try that, thanks.

Quote: "Good luck, this sounds pretty annoying."


'Tis.

(Why am I quoting every single part of your post? Ask someone who isn't as tired as I am. Who? *bedtime....* Did I mention I'm tired?)

Clonkex

Login to post a reply

Server time is: 2024-05-06 16:28:40
Your offset time is: 2024-05-06 16:28:40