Skip to main content

destroy

method Agent.prototype.destroy
Jump to headingAgent.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 Jump to heading

void
Back to top