'Sends data to the remote server. This method is called
when HTTPretty identifies that someone is trying to send
non-http data.
The received bytes are written in this socket\'s StringIO
buffer so that HTTPretty can return it accordingly when
necessary.'

def real_sendall(self, data, *args, **kw):

    if (not self.truesock):
        raise UnmockedError()
    if (not self.is_http):
        return self.truesock.sendall(data, *args, **kw)
    self.truesock.connect(self._address)
    self.truesock.setblocking(1)
    self.truesock.sendall(data, *args, **kw)
    should_continue = True
    while should_continue:
        try:
            received = self.truesock.recv(self._bufsize)
            self.fd.write(received)
            should_continue = (len(received) == self._bufsize)
        except socket.error as e:
            if (e.errno == EAGAIN):
                continue
            break
    self.fd.seek(0)
