Skip to main content
Agent.prototype.destroy - http - Node documentation
method Agent.prototype.destroy

Usage in Deno

import { Agent } from "node:http";
Agent.prototype.destroy(): void

Destroy any sockets that are currently in use by the agent.

It is usually not necessary to do this. However, if using an agent with keepAlive enabled, then it is best to explicitly shut down the agent when it is no longer needed. Otherwise, sockets might stay open for quite a long time before the server terminates them.

Return Type

void