dump_fds: add flags and address parameter
Expose the flags, address parameter of the underlying sock.sendmsg method, in order to be able to explicitly specify the recipient of the message; as needed in connection-less mode.
This commit is contained in:
parent
1c5b97afbc
commit
76518db26b
1 changed files with 3 additions and 2 deletions
|
|
@ -25,8 +25,9 @@ def load_fds(sock, msglen):
|
|||
return json.loads(msg), list(fds), addr
|
||||
|
||||
|
||||
def dump_fds(sock, obj, fds):
|
||||
sock.sendmsg([json.dumps(obj).encode('utf-8')], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))])
|
||||
def dump_fds(sock, obj, fds, flags=0, addr=None):
|
||||
ancillary = [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds))]
|
||||
sock.sendmsg([json.dumps(obj).encode('utf-8')], ancillary, flags, addr)
|
||||
|
||||
|
||||
class LoopServer:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue