pdcomm_tcp_destroy
Function
Releases an endpoint and its sockets.
void pdcomm_tcp_destroy(PdcommTcpEndpoint *endpoint)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
| Name | Description |
|---|---|
endpoint | Endpoint from pdcomm_tcp_create(), or NULL (no effect). |
Notes
- Lifetime: destroy each endpoint exactly once, after every other call on it has returned.