(self, retr)
return data.strip()
Send and receive
Send and receive
Send and receive
def send(self, retr):
        """Send and receive"""
        try:
            sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            sock.settimeout(5)
            sock.sendto(retr, (self.config['target'].value, 69))
            data = sock.recv(1024)
            sock.close()
        except Exception, e:
            util.Error('Error with host: %s' % e)
            return None
        return data.strip()
def send ( self , retr ) : try : sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) sock . settimeout ( 5 ) sock . sendto ( retr , ( self . config [ 'target' ] . value , 69 ) ) data = sock . recv ( 1024 ) sock . close ( ) except Exception , e : util . Error ( 'Error with host: %s' % e ) return None return data . strip ( )