(self, sock_info)
Return the socket to the pool, or if it's closed discard it.
Return the socket to the pool, or if it's closed discard it.
Return the socket to the pool or if it s closed discard it .
def return_socket(self, sock_info):
        """Return the socket to the pool, or if it's closed discard it."""
        if self.pid != os.getpid():
            self.reset()
        else:
            if sock_info.pool_id != self.pool_id:
                sock_info.close()
            elif not sock_info.closed:
                sock_info.last_checkin = _time()
                with self.lock:
                    self.sockets.add(sock_info)

        self._socket_semaphore.release()
        with self.lock:
            self.active_sockets -= 1
def return_socket ( self , sock_info ) : if self . pid != os . getpid ( ) : self . reset ( ) else : if sock_info . pool_id != self . pool_id : sock_info . close ( ) elif not sock_info . closed : sock_info . last_checkin = _time ( ) with self . lock : self . sockets . add ( sock_info ) self . _socket_semaphore . release ( ) with self . lock : self . active_sockets -= 1