pdcomm_tcp_linktest
Function
Sends Linktest.req to check that the connection is alive.
PdcommStatus pdcomm_tcp_linktest(PdcommTcpEndpoint *endpoint, PdcommTcpToken *out_token)A successful Linktest.rsp produces no event: the token simply stops being pending (see pdcomm_tcp_is_pending()). A missing response produces a #PDCOMM_TCP_FAILED event with #PDCOMM_TCP_T6_TIMEOUT and closes the connection. Only one Linktest can be outstanding at a time.
Parameters
| Name | Description |
|---|---|
endpoint | Live endpoint in the #PDCOMM_TCP_NOT_SELECTED or #PDCOMM_TCP_SELECTED state. |
out_token | Receives the control transaction token; all zeros after every failure. Must not be NULL. |
Returns
#PDCOMM_OK when Linktest.req was queued; #PDCOMM_INVALID_ARGUMENT when out_token or endpoint is NULL; #PDCOMM_INVALID_STATE when the endpoint is not connected; #PDCOMM_BACKPRESSURE when a Linktest is already outstanding, all transaction slots are in use, an event is staged, a queue is full, or the endpoint is stopping; #PDCOMM_LIMIT_EXCEEDED when the system bytes are exhausted; #PDCOMM_POISONED.