Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow initial rendering without creating socket #403

Open
Laudrin opened this issue Aug 5, 2024 · 1 comment
Open

Allow initial rendering without creating socket #403

Laudrin opened this issue Aug 5, 2024 · 1 comment
Labels
Backend enhancement New feature or request

Comments

@Laudrin
Copy link

Laudrin commented Aug 5, 2024

Thank you for the great tool! 🙂

If I have mapserver (v4.9.1 on Windows 10 64 bit) running for a world I'm playing in at the moment and try letting mapserver do the initial rendering of another world in the background, mapserver tries to create a socket on a fixed address before starting rendering. Of course this fails with an error, as the socket on that address is already open.

panic: listen tcp :8080: bind: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.

(Retranslation:) Normally, each socket address (protocol, network address or connection) may only be used once.

This could also happen if there is another program using that socket, so this is not only in case you want to render other worlds while mapserver is active for one world.

mapserver -help gives no help to change the socket address, after checking the world directory, I found the mapserver.json, changed the socket address and got mapserver running in the background. So far, so good, but this is not optimal if you only want to run the initial rendering for a world and have each world on the same socket address when active.

So I would suggest the following improvements for the command line / mapserver arguments:

  • mapserver -initialize: Only does initial rendering without opening a socket and exits after initialization is done.
  • mapserver -temporary:8081: Starts mapserver and uses the given address without writing it to the mapserver.json
  • mapserver -permanent:8081: Starts mapserver and uses the given address and saves it to the mapserver.json, using it as default when starting next time without arguments.
  • Additionally mapserver should check if the socket is already taken and use the next free one. If necessary, this could be suppressed by mapserver -fixed-socket which will tell mapserver to only use the socket given in the config file, exiting with an error like before if it is taken.

Of course the commands are only suggestions. 🙂 What do you think about that?

@Laudrin
Copy link
Author

Laudrin commented Aug 6, 2024

Another idea for the user's convenience:

mapserver -open-in-browser would open the map in the user's standard browser, using the socked/port saved in mapserver.json.

@BuckarooBanzay BuckarooBanzay added enhancement New feature or request Backend labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants