mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 03:33:28 +00:00
If port zero is specified, Redis will not listen for TCP connections
This commit is contained in:
parent
452229b6fb
commit
68d6345ddf
@ -21,6 +21,7 @@ daemonize no
|
|||||||
pidfile /var/run/redis.pid
|
pidfile /var/run/redis.pid
|
||||||
|
|
||||||
# Accept connections on the specified port, default is 6379.
|
# Accept connections on the specified port, default is 6379.
|
||||||
|
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||||
port 6379
|
port 6379
|
||||||
|
|
||||||
# If you want you can bind a single interface, if the bind option is not
|
# If you want you can bind a single interface, if the bind option is not
|
||||||
|
@ -864,7 +864,10 @@ void initServer() {
|
|||||||
createSharedObjects();
|
createSharedObjects();
|
||||||
server.el = aeCreateEventLoop();
|
server.el = aeCreateEventLoop();
|
||||||
server.db = zmalloc(sizeof(redisDb)*server.dbnum);
|
server.db = zmalloc(sizeof(redisDb)*server.dbnum);
|
||||||
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
|
|
||||||
|
if (server.port != 0)
|
||||||
|
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
|
||||||
|
|
||||||
if (server.ipfd == ANET_ERR) {
|
if (server.ipfd == ANET_ERR) {
|
||||||
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
|
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user