A fake for socket.socket objects.

Instance Variable data A str giving the data which will be returned from FakeSocket.recv.
Instance Variable sendBuffer A list of the objects passed to FakeSocket.send.
Method __init__ Undocumented
Method setblocking Undocumented
Method recv Undocumented
Method send Send all of bytes by accumulating it into self.sendBuffer.
Method shutdown Shutdown is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.
Method close Close is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.
Method setsockopt Setsockopt is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.
Method fileno Return a fake file descriptor. If actually used, this will have no connection to this FakeSocket and will probably cause surprising results.
data =
A str giving the data which will be returned from FakeSocket.recv.
sendBuffer =
A list of the objects passed to FakeSocket.send.
def __init__(self, data):
Undocumented
def setblocking(self, blocking):
Undocumented
def recv(self, size):
Undocumented
def send(self, bytes):

Send all of bytes by accumulating it into self.sendBuffer.

ReturnsThe length of bytes, indicating all the data has been accepted.
def shutdown(self, how):

Shutdown is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.

def close(self):

Close is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.

def setsockopt(self, *args):

Setsockopt is not implemented. The method is provided since real sockets have it and some code expects it. No behavior of FakeSocket is affected by a call to it.

def fileno(self):

Return a fake file descriptor. If actually used, this will have no connection to this FakeSocket and will probably cause surprising results.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.