MYQTT_SOCKET myqtt_conn_sock_connect_common ( MyQttCtx ctx,
const char *  host,
const char *  port,
int *  timeout,
MyQttNetTransport  transport,
axlError **  error 
)

Allows to create a plain socket connection against the host and port provided allowing to configure the transport.

This function differs from myqtt_conn_sock_connect in the sense it allows to configure the transport (MyQttNetTransport) so you can create TCP/IPv4 (MYQTT_IPv4) and TCP/IPv6 (MYQTT_IPv6) connections.

Parameters
ctxThe context where the connection happens.
hostThe host server to connect to.
portThe port server to connect to.
timeoutParameter where optionally is returned the timeout defined by the library (myqtt_conn_get_connect_timeout) that remains after only doing a socket connected. The value is only returned if the caller provide a reference.
transportThe network transport to use for this connect operation.
errorOptional axlError reference to report an error code and a textual diagnostic.
Returns
A connected socket or -1 if it fails. The particular error is reported at axlError optional reference.

References myqtt_conn_get_connect_timeout(), myqtt_conn_set_sock_block(), myqtt_conn_set_sock_tcp_nodelay(), MYQTT_IPv4, MYQTT_IPv6, MyQttConnectionError, MyQttNameResolvFailure, MyQttSocketSanityError, and WRITE_OPERATIONS.

Referenced by myqtt_conn_sock_connect().