ms: Use the new API to pass credentials to the event server

We are using the "autobind" feature of Linux to get a special
socket address. This allows us to have roughly 2^20 clients on
the system.

Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
This commit is contained in:
Holger Hans Peter Freyther 2018-06-17 19:31:46 +01:00 committed by Holger Freyther
parent 99efe820e4
commit 05895a912d
3 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@ class EventServer(log.Origin):
def read_cb(self, obj, mask):
# addresss doesn't give us the remote but currently we don't
# need it.
(data, address) = self._server.recvfrom(4096)
data, ancdata, flags, addr = self._server.recvmsg(4096, 4096)
now = time.clock_gettime(time.CLOCK_MONOTONIC)
for handler in self._handlers:
handler(data, now)
handler(data, addr, now)

View File

@ -167,7 +167,7 @@ class MassUpdateLocationTest(log.Origin):
for launcher in self._started:
launcher.kill()
def handle_msg(self, _data, time):
def handle_msg(self, _data, addr, time):
import json
data = json.loads(_data.decode())

View File

@ -11,6 +11,7 @@ local mod = {}
function mod.register(ms, path)
g_ms = ms
osmo.unix_passcred(g_c:getfd())
g_c:connect(path)
local event = {}