Parsec

ParsecClientNewAttempt

ParsecStatusParsecClientNewAttempt(Parsec *
ps,
const ParsecClientConfig *
cfg,
const char *
attemptID,
ParsecProtocol
protocol,
ParsecCredentials *
creds
)

Begin connecting to a remote Parsec host.

Performs authentication, peer-to-peer negotiation, and NAT traversal. This function operates asynchronously and will return immediately. Call ParsecClientGetStatus to determine if the client has successfully connected or is in an error state.

Parameters

DirectionNameDescription
inpsParsec instance returned by ParsecInit.
incfgClient configuration. May be left NULL to use PARSEC_CLIENT_DEFAULTS.
inattemptIDThe unique attempt ID that the client assigns to this.
inprotocolThe ParsecProtocol to use for the connection, should always be PROTO_MODE_BUD for non browsers.
incredsThe ParsecCredentials for the STUN phase.

Returns

PARSEC_OK if the connection attempt is underway, PARSEC_ALREADY_RUNNING if there is an active connection.