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,
)
| 17 | |
| 18 | |
| 19 | def 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 | |
| 40 | def recvmsg( |
no outgoing calls