twisted.python.sendmsg
module documentationtwisted.python
View Source
sendmsg(2) and recvmsg(2) support for Python.
Function | sendmsg | Send a message on a socket. |
Function | recvmsg | Recieve a message on a socket. |
Function | getSocketFamily | Return the family of the given socket. |
Send a message on a socket.
Parameters | socket | The socket to send the message on. (type: socket.socket ) |
data | Bytes to write to the socket. (type: bytes) | |
ancillary | Extra data to send over the socket outside of the normal datagram or stream
mechanism. By default no ancillary data is sent. (type: list of tuple of int ,
int , and bytes .) | |
flags | Flags to affect how the message is sent. See the MSG_
constants in the sendmsg(2) manual page. By default no flags are set. (type: int ) | |
Returns | The return value of the underlying syscall, if it succeeds. |
Recieve a message on a socket.
Parameters | socket | The socket to recieve the message on. (type: socket.socket ) |
maxSize | The maximum number of bytes to receive from the socket using the datagram
or stream mechanism. The default maximum is 8192. (type: int ) | |
cmsgSize | The maximum number of bytes to receive from the socket outside of the
normal datagram or stream mechanism. The default maximum is 4096. (type: int ) | |
flags | Flags to affect how the message is sent. See the MSG_
constants in the sendmsg(2) manual page. By default no flags are set. (type: int ) | |
Returns | A named 3-tuple of the bytes recieved using the datagram/stream mechanism,
a list
of tuple s
giving ancillary recieved data, and flags as an int
describing the data recieved. |