def socket_send(self):
        """Send data to the client socket.

        Called by TelnetServer when there is data ready to send.

        """
        if len(self.send_buffer):
            try:
                # Convert to ANSI before sending.
                sent = self.sock.send(bytes(self.send_buffer, "cp1252"))
            except socket.error as err:
                logging.error("SEND error '{}' from {}".format(
                    err, self.addrport()))
                self.active = False
                return
            self.bytes_sent += sent
            self.send_buffer = self.send_buffer[sent:]
        else:
            self.send_pending = False