pdcomm_tcp_start
Function
Starts a new connection generation.
PdcommStatus pdcomm_tcp_start(PdcommTcpEndpoint *endpoint)The endpoint increments its generation and enters #PDCOMM_TCP_CONNECTING (active) or #PDCOMM_TCP_LISTENING (passive). No connection is made here: pdcomm_tcp_poll() performs the connect or accept. After a stop, a passive endpoint binds its listening socket again.
Parameters
| Name | Description |
|---|---|
endpoint | Live endpoint. |
Returns
#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when endpoint is NULL; #PDCOMM_INVALID_STATE when the endpoint is not stopped or is still closing its previous connection; #PDCOMM_BACKPRESSURE when an event is staged (see pdcomm_tcp_next_event()) or the event queue is full; #PDCOMM_IO_ERROR when the passive socket cannot be bound again; #PDCOMM_LICENSE_REQUIRED when the endpoint is stopped and no license grants the secs-gem module (the endpoint stays stopped); #PDCOMM_POISONED.
Notes
- When a GEM role is configured, the call also updates the GEM state.