Skip to content
Start free evaluation

pdcomm_tcp_destroy

Function

Releases an endpoint and its sockets.

void pdcomm_tcp_destroy(PdcommTcpEndpoint *endpoint)

Declared in: #include <pdcomm_tcp.h>

Destruction closes the sockets immediately and does not promise a graceful shutdown on the wire. For a graceful close, call pdcomm_tcp_stop(), poll and drain events until PdcommTcpState::closed is 1, and then destroy the endpoint. Events and GEM results obtained earlier stay valid. Destroying a poisoned endpoint is allowed.

Parameters

NameDescription
endpointEndpoint from pdcomm_tcp_create(), or NULL (no effect).

Notes

  • Lifetime: destroy each endpoint exactly once, after every other call on it has returned.