Demo 45c - MonkeyGame doesn't start

Monkey Archive Forums/Monkey Discussion/Demo 45c - MonkeyGame doesn't start

Floyd(Posted 2011) [#1]
There is a question at blitzbasic.com about MonkeyGame.html not launching from Monk, although it can be started manually. I tried installing the demo but could not reproduce the problem. Maybe somebody else has an idea.

The relevant thread is here.


therevills(Posted 2011) [#2]
Looks like its a Windows 7 issue with local host. By googling I found a few posts on the problem.


Armitage1982(Posted 2011) [#3]
Hi Floyd,

Nice to post the question here on monkeycoder.
Now that I am a registered user I will post the answer just in case new corner run into the same problem.

Like Therevills is correctly pointing, it's a problem with the host file.
Under windows, you can find the host file at this location:
%WINDIR%\system32\drivers\etc\

Inside this file, make sure you have something like this: 127.0.0.1 localhost
Preferably at the end of the file, just because this is the default localhost IP address and should never be replaced.

Mine was replaced by another IP address.

This result in a browser unable to find the correct MonkeyGame.html produced by Monkey and redirected by the HTML5 server.

Thanks again for asking this here :)


Floyd(Posted 2011) [#4]
That's interesting. The demo works on my Windows 7 PC. My hosts file does not contain anything!

The file is not actually empty, but every line is commented out, for example:

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost



dawlane(Posted 2011) [#5]
There is a possibility that when IIS (Internet Information Services), Apache or some other service/application is installed that there is a port conflict.

I did have an issue with IIS and localhost while I was playing with Netbeans 7.01 the other day. In the end I had to use the IIS Manager and bind the IP to 127.0.0.1:8080/localhost, set the site to a directory that I was working on and modify the host file to get it to work from within Netbeans using localhost instead of typing 127.0.0.1 in the project settings.


DruggedBunny(Posted 2011) [#6]
@Floyd - Mine's the same.

My reading of "localhost name resolution is handled within DNS itself" is that localhost is now automatically defined/resolved elsewhere in Windows 7 by default (maybe within the actual TCP/IP stack?), but can be over-ridden via HOSTS, whereas previously it was always defined in HOSTS.


Armitage1982(Posted 2011) [#7]
That's interesting. The demo works on my Windows 7 PC. My hosts file does not contain anything!


In fact, it's also work when you have nothing inside. This probably explain "localhost name resolution is handled within DNS itself".

Like dawlane said, it's only a problem if your localhost is mapped to something else as last entry. For example : 198.150.1.1:80 localhost.


therevills(Posted 2011) [#8]
When I looked into this, the reason why local host is handled within DNS is due to IPv6... for some reason Microsoft had to change it to get it to work with IPv6.

http://serverfault.com/questions/4689/windows-7-localhost-name-resolution-is-handled-within-dns-itself-why

At some point in the future, as the world transitions from IPV4 to IPV6, IPV4 will be eventually be disabled/uninstalled by companies that want to simplfy network management in their environments.

With Windows Vista, when IPv4 was uninstalled and IPv6 was enabled, a DNS query for an A (IPv4) address resulted in the IPv4 loopback (which came from the hosts file). This of course caused problems when IPv4 was not installed. The fix was to move the always present IPv4 and IPv6 loopback entries from the host into the DNS resolver, where they could be independently disabled.