News: Portal
Our Simutrans site. You can find everything about Simutrans from here.

Network patch - improve logging + remove use of NTOP/PTON

Started by Ashley, February 18, 2012, 03:26:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


This patch does a few things:

1. Improves logging for server startup, printing out which addresses the server is listening on (before these were mere debug messages which could be missed).
2. The server fails to start if it cannot listen on any of the addresses specified in the config file. I feel that this should be an error condition since it indicates that the server probably shouldn't be running (e.g. if there is another server bound to the same ports).
3. I've removed the code which uses inet_ntop and inet_pton - this was really unnecessary given that getaddrinfo() does validation (and indeed permits domain names) and getnameinfo() can be made to return numeric IPs by specifying the NI_NUMERICHOST flag (this was incorrectly set to the NI_NUMERICSERV flag in the code).
4. As a result, you can specify a DNS name in the listen directive of, which will be resolved into IP addresses all of which will then be listened on. This is nice for flexible configuration.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.


Parsley, sage, rosemary, and maggikraut.