def send_data(self, sock, data):
        if hasattr(data, 'read'):
            try:
                data.seek(0)
            except (__HOLE__, IOError):
                pass
            
            while True:
                chunk = data.readline()
                if not chunk:
                    break
                sock.sendall(chunk)    
        elif isinstance(data, basestring):
           sock.sendall(data)
        else:
            for chunk in data:
                sock.sendall(chunk)
dataset/ETHPy150Open benoitc/tproxy/tproxy/client.py/ClientConnection.send_data