Known implementations: twisted.pair.test.test_tuntap.TestRealSystem, 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):
See Alsoos.open
def ioctl(fd, opt, arg=None, mutate_flag=None):
See Alsofcntl.ioctl
def read(fd, limit):
See Alsoos.read
def write(fd, data):
See Alsoos.write
def close(fd):
See Alsoos.close
def sendUDP(datagram, address):

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):

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 2020-03-25 17:34:30.