(self, s)
Cache socket for a moment, then recreate it.
Cache socket for a moment, then recreate it.
Cache socket for a moment then recreate it .
def send(self, s):
        """ Cache socket for a moment, then recreate it.
        """
        now = time.time()
        if now - 1 > self._udp_reset:
            if self.sock:
                self.sock.close()
            self.sock = self.makeSocket()
            self._udp_reset = now
        self.sock.sendto(s, (self.host, self.port))
def send ( self , s ) : now = time . time ( ) if now - 1 > self . _udp_reset : if self . sock : self . sock . close ( ) self . sock = self . makeSocket ( ) self . _udp_reset = now self . sock . sendto ( s , ( self . host , self . port ) )