GNOME Bugzilla – Bug 742115
Examples: Accept a 'port' argument for running multiple instances
Last modified: 2014-12-30 16:07:42 UTC
Created attachment 293475 [details] [review] Add command-line parsing and take a 'port' argument For examples that take arguments (a launch pipeline, a filename, uri, etc), add a port argument so that users can run multiple instances for testing. The implementation uses GOptionEntry, so the patch is rather trivial.
- any reason not to make the port an INT argument? Seems more natural. - I think these lines should just be copy'n'pasted into each .c file instead of having a shared header just for this
(In reply to comment #1) > - any reason not to make the port an INT argument? Seems more natural. > The "service" property on the server (which is the port) takes a string argument, so I thought I'd just pass it straight on instead of doing a conversion. > - I think these lines should just be copy'n'pasted into each .c file instead > of having a shared header just for this Updated patch incoming. :)
Created attachment 293476 [details] [review] Add command-line parsing and take a 'port' argument This patch removes the header and copy-pastes the code into each file. In addition, the variables are now static.
Thanks, pushed: commit e0d3807cbbba6c24d24b6a9cf8e8e11005b74c51 Author: Nirbheek Chauhan <nirbheek@centricular.com> Date: Tue Dec 30 18:13:49 2014 +0530 examples: Add command-line parsing and take a 'port' argument This allows users to run multiple servers on different ports for testing. Only done for examples that actually take arguments and hence are capable of outputting different streams for each instance on each port. https://bugzilla.gnome.org/show_bug.cgi?id=742115