17 Commits

Author SHA1 Message Date
Geoff Garside
e04fdf26fe Add IPv6 support to sentinel.c.
This has been done by exposing the anetSockName() function anet.c
to be used when the sentinel is publishing its existence to the masters.

This implementation is very unintelligent as it will likely break if used
with IPv6 as the nested colons will break any parsing of the PUBLISH string
by the master.
2013-07-08 16:08:36 +02:00
Geoff Garside
56df827198 Add anetTcp6Server() function.
Refactor the common code from anetTcpServer into internal function which
can be used by both anetTcpServer and anetTcp6Server.
2013-07-08 15:58:14 +02:00
Geoff Garside
ef839f9006 Use inet_ntop(3) in anet. #apichange
Replace inet_ntoa(3) calls with the more future proof inet_ntop(3)
function which is capable of handling additional address families.

API Change: anetTcpAccept() & anetPeerToString() additional argument
  additional argument required to specify the length of the character
  buffer the IP address is written to in order to comply with
  inet_ntop(3) function semantics.
2013-07-08 15:50:15 +02:00
Geoff Garside
071963c855 Use getaddrinfo(3) in anetResolve. #apichange
Change anetResolve() function to use getaddrinfo(3) to resolve hostnames.
Resolved hostnames are limited to those reachable by the AF_INET address
family.

API Change: anetResolve requires additional argument.
  additional argument required to specify the length of the character
  buffer the IP address is written to in order to comply with
  inet_ntop(3) function semantics. inet_ntop(3) replaces inet_ntoa(3)
  as it has been designed to be compatible with more address families.
2013-07-08 15:47:57 +02:00
antirez
c978b864f7 Revert "anet.c: Allow creation of TCP listening sockets bound to N addresses."
Bind() can't be called multiple times against the same socket, multiple
sockets are required to bind multiple interfaces, silly me.

This reverts commit bd234d62bbfe9feb735fd6d1cdb8f5ce811f54b4.
2013-07-05 11:07:55 +02:00
antirez
bd234d62bb anet.c: Allow creation of TCP listening sockets bound to N addresses. 2013-07-04 18:48:46 +02:00
antirez
ee21c18e5d Add SO_KEEPALIVE support to anet.c. 2013-02-08 16:30:26 +01:00
antirez
b70b459b0e TCP_NODELAY after SYNC: changes to the implementation. 2013-02-05 12:04:30 +01:00
charsyam
c85647f354 Turn off TCP_NODELAY on the slave socket after SYNC.
Further details from @antirez:

It was reported by @StopForumSpam on Twitter that the Redis replication
link was strangely using multiple TCP packets for multiple commands.
This wastes a lot of bandwidth and is due to the TCP_NODELAY option we
enable on the socket after accepting a new connection.

However the master -> slave channel is a one-way channel since Redis
replication is asynchronous, so there is no point in trying to reduce
the latency, we should aim to reduce the bandwidth. For this reason this
commit introduces the ability to disable the nagle algorithm on the
socket after a successful SYNC.

This feature is off by default because the delay can be up to 40
milliseconds with normally configured Linux kernels.
2013-02-05 12:04:25 +01:00
antirez
4365e5b2d3 BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
Nathan Florea
8523876503 Added a config directive for a Unix socket mask
Added a configuration directive to allow a user to specify the
permissions to be granted to the Unix socket file.  I followed
the format Pieter and Salvatore discusses in issue #85 (
https://github.com/antirez/redis/issues/85).
2011-10-10 11:21:15 -07:00
antirez
3cd12b5687 CLIENT LIST implemented 2011-04-21 15:38:02 +02:00
Pieter Noordhuis
65b472acce Solaris 10 doesn't know AF_LOCAL 2010-12-23 11:09:07 +00:00
Pieter Noordhuis
4fe83b554a sockaddr_un.sun_path appears to never hold anything after accept() 2010-10-13 18:50:07 +02:00
Pieter Noordhuis
ab17b909fe Use different accept handlers for TCP and unix socket connections 2010-10-13 18:34:24 +02:00
Pieter Noordhuis
c61e69257a Support for Redis to listen on a Unix socket 2010-08-01 22:55:24 +02:00
antirez
e2641e09cc redis.c split into many different C files.
networking related stuff moved into networking.c

moved more code

more work on layout of source code

SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;)

cleanly compiling again after the first split, now splitting it in more C files

moving more things around... work in progress

split replication code

splitting more

Sets split

Hash split

replication split

even more splitting

more splitting

minor change
2010-07-01 14:38:51 +02:00