MCPcopy Create free account
hub / github.com/twisted/twisted / sendmsg

Function sendmsg

src/twisted/python/sendmsg.py:19–37  ·  view source on GitHub ↗

Send a message on a socket. @param socket: The socket to send the message on. @param data: Bytes to write to the socket. @param ancillary: Extra data to send over the socket outside of the normal datagram or stream mechanism. By default no ancillary data is sent. @para

(
    socket: Socket,
    data: bytes,
    ancillary: list[tuple[int, int, bytes]] = [],
    flags: int = 0,
)

Source from the content-addressed store, hash-verified

17
18
19def sendmsg(
20 socket: Socket,
21 data: bytes,
22 ancillary: list[tuple[int, int, bytes]] = [],
23 flags: int = 0,
24) -> int:
25 """
26 Send a message on a socket.
27
28 @param socket: The socket to send the message on.
29 @param data: Bytes to write to the socket.
30 @param ancillary: Extra data to send over the socket outside of the normal
31 datagram or stream mechanism. By default no ancillary data is sent.
32 @param flags: Flags to affect how the message is sent. See the C{MSG_}
33 constants in the sendmsg(2) manual page. By default no flags are set.
34
35 @return: The return value of the underlying syscall, if it succeeds.
36 """
37 return socket.sendmsg([data], ancillary, flags)
38
39
40def recvmsg(

Callers 10

test_roundtripMethod · 0.90
test_shortsendMethod · 0.90
test_flagsMethod · 0.90
test_sendSubProcessFDMethod · 0.90
test_recvfdMethod · 0.90
test_mainMethod · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by 8

test_roundtripMethod · 0.72
test_shortsendMethod · 0.72
test_flagsMethod · 0.72
test_sendSubProcessFDMethod · 0.72
test_recvfdMethod · 0.72
test_mainMethod · 0.72