Known implementations: twisted.pair.testing.MemoryIOSystem

An interface for performing some basic kinds of I/O (particularly that I/O which might be useful for twisted.pair.tuntap-using code).

Attribute O_RDWR
Attribute O_NONBLOCK
Attribute O_CLOEXEC
Method open
Method ioctl
Method read
Method write
Method close
Method sendUDP Send a datagram to a certain address.
Method receiveUDP Return a socket which can be used to receive datagrams sent to the given address.
O_RDWR =
See Alsoos.O_RDWR
O_NONBLOCK =
See Alsoos.O_NONBLOCK
O_CLOEXEC =
See Alsoos.O_CLOEXEC
def open(filename, flag, mode=511): (source)
See Alsoos.open
def ioctl(fd, opt, arg=None, mutate_flag=None): (source)
See Alsofcntl.ioctl
def read(fd, limit): (source)
See Alsoos.read
def write(fd, data): (source)
See Alsoos.write
def close(fd): (source)
See Alsoos.close
def sendUDP(datagram, address): (source)

Send a datagram to a certain address.

ParametersdatagramThe payload of a UDP datagram to send. (type: bytes)
addressThe destination to which to send the datagram. (type: tuple of (bytes, int))
ReturnsThe local address from which the datagram was sent. (type: tuple of (bytes, int))
def receiveUDP(fileno, host, port): (source)

Return a socket which can be used to receive datagrams sent to the given address.

ParametersfilenoA file descriptor representing a tunnel device which the datagram was either sent via or will be received via. (type: int)
hostThe IPv4 address at which the datagram will be received. (type: bytes)
portThe UDP port number at which the datagram will be received. (type: int)
ReturnsA socket.socket which can be used to receive the specified datagram.
API Documentation for Twisted, generated by pydoctor at 2016-04-04 15:02:49.