'send(data)
Send \'data\' to remote.'

def send(self, data):

    if (self.compressor is not None):
        data = self.compressor.compress(data)
        data += self.compressor.flush(zlib.Z_SYNC_FLUSH)
    if (bytes != str):
        data = bytes(data, 'utf8')
    if hasattr(self.sock, 'sendall'):
        self.sock.sendall(data)
    else:
        dlen = len(data)
        while (dlen > 0):
            sent = self.sock.write(data)
            if (sent == dlen):
                break
            data = data[sent:]
            dlen = (dlen - sent)
