interface documentation

class _IInputOutputSystem(Interface): (source)

Known implementations: twisted.pair.testing.MemoryIOSystem

View In Hierarchy

An interface for performing some basic kinds of I/O (particularly that I/O which might be useful for twisted.pair.tuntap-using code).
Method close
Method ioctl
Method open
Method read
Method receiveUDP Return a socket which can be used to receive datagrams sent to the given address.
Method sendUDP Send a datagram to a certain address.
Method write
Attribute O_CLOEXEC
Attribute O_NONBLOCK
Attribute O_RDWR
def close(fd): (source)
See Also
os.close
def ioctl(fd, opt, arg=None, mutate_flag=None): (source)
See Also
fcntl.ioctl
def open(filename, flag, mode=511): (source)
See Also
os.open
def read(fd, limit): (source)
See Also
os.read
def receiveUDP(fileno, host, port): (source)
Return a socket which can be used to receive datagrams sent to the given address.
Parameters
fileno:intA file descriptor representing a tunnel device which the datagram was either sent via or will be received via.
host:bytesThe IPv4 address at which the datagram will be received.
port:intThe UDP port number at which the datagram will be received.
Returns
A socket.socket which can be used to receive the specified datagram.
def sendUDP(datagram, address): (source)
Send a datagram to a certain address.
Parameters
datagram:bytesThe payload of a UDP datagram to send.
address:tuple of (bytes, int)The destination to which to send the datagram.
Returns
tuple of (bytes, int)The local address from which the datagram was sent.
def write(fd, data): (source)
See Also
os.write
O_CLOEXEC = (source)
See Also
os.O_CLOEXEC
O_NONBLOCK = (source)
See Also
os.O_NONBLOCK
O_RDWR = (source)
See Also
os.O_RDWR