On 1. mars 2011, at 00.00, Adam Lee wrote:
> On Feb 28, 2011 5:04 PM, "Trond Norbye" <[email protected]> wrote:
> > I don't have any huge objections to this patch, but I'd rather change the
> > logic so instead of specifying the number of ports and have them in a range
> > I'd prefer if we used multiple -h hostname:port and -U hostname:port. That
> > would allow you to bind to multiple specific interfaces and multiple port
> > numbers.. ex: -h *:11211 -h *:11212 -h *:11213 etc
>
> this sounds excellent!
>
>
I forgot that -h was used to get the help text and not the host name ;-)
Anyway. I pushed a path that gives you the functionality through the -l
parameter:
-l <addr> interface to listen on (default: INADDR_ANY, all addresses)
<addr> may be specified as host:port. If you don't specify
a port number the value you specified with -p or -U is
used. You may specify multiple addresses separated by comma
or by using -l multiple times
That means you can do:
./memcached -l localhost:11210,*:11213,*
./memcached -l localhost:11210 -l *:11213 -l \*
./memcached -l localhost -p 11213
./memcached -l localhost:11213 -l \* -p 11210
See
https://github.com/memcached/memcached/commit/6ba9aa2771adcf785fe3fde03cd71832db15b086
Trond