Connection establishment/teardown functions.
More...
|
DXFEED_API ERRORCODE | dxf_create_connection (const char *address, dxf_conn_termination_notifier_t notifier, dxf_conn_status_notifier_t conn_status_notifier, dxf_socket_thread_creation_notifier_t stcn, dxf_socket_thread_destruction_notifier_t stdn, void *user_data, OUT dxf_connection_t *connection) |
| Creates connection with the specified parameters. More...
|
|
DXFEED_API ERRORCODE | dxf_create_connection_auth_basic (const char *address, const char *user, const char *password, dxf_conn_termination_notifier_t notifier, dxf_conn_status_notifier_t conn_status_notifier, dxf_socket_thread_creation_notifier_t stcn, dxf_socket_thread_destruction_notifier_t stdn, void *user_data, OUT dxf_connection_t *connection) |
| Creates connection with the specified parameters and basic authorization. More...
|
|
DXFEED_API ERRORCODE | dxf_create_connection_auth_bearer (const char *address, const char *token, dxf_conn_termination_notifier_t notifier, dxf_conn_status_notifier_t conn_status_notifier, dxf_socket_thread_creation_notifier_t stcn, dxf_socket_thread_destruction_notifier_t stdn, void *user_data, OUT dxf_connection_t *connection) |
| Creates connection with the specified parameters and token authorization. More...
|
|
DXFEED_API ERRORCODE | dxf_create_connection_auth_custom (const char *address, const char *authscheme, const char *authdata, dxf_conn_termination_notifier_t notifier, dxf_conn_status_notifier_t conn_status_notifier, dxf_socket_thread_creation_notifier_t stcn, dxf_socket_thread_destruction_notifier_t stdn, void *user_data, OUT dxf_connection_t *connection) |
| Creates connection with the specified parameters and custom described authorization. More...
|
|
DXFEED_API ERRORCODE | dxf_close_connection (dxf_connection_t connection) |
| Closes a connection. More...
|
|
DXFEED_API ERRORCODE | dxf_get_connection_properties_snapshot (dxf_connection_t connection, OUT dxf_property_item_t **properties, OUT int *count) |
| Retrieves the array of key-value pairs (properties) for specified connection. More...
|
|
DXFEED_API ERRORCODE | dxf_free_connection_properties_snapshot (dxf_property_item_t *properties, int count) |
| Frees memory allocated during dxf_get_connection_properties_snapshot function execution. More...
|
|
DXFEED_API ERRORCODE | dxf_get_current_connected_address (dxf_connection_t connection, OUT char **address) |
| Retrieves the null-terminated string with current connected address in format <host>:<port> . More...
|
|
DXFEED_API ERRORCODE | dxf_get_current_connection_status (dxf_connection_t connection, OUT dxf_connection_status_t *status) |
| Retrieves the current connection status. More...
|
|
Connection establishment/teardown functions.
◆ dxf_close_connection()
Closes a connection.
- Parameters
-
[in] | connection | A handle of a previously created connection |
- Returns
- DXF_SUCCESS on successful connection closure or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure.
◆ dxf_create_connection()
Creates connection with the specified parameters.
- Parameters
-
[in] | address | Connection string
- the single address:
host:port or just host
- address with credentials:
host:port[username=xxx,password=yyy]
- multiple addresses:
(host1:port1)(host2)(host3:port3[username=xxx,password=yyy])
- the data from file:
/path/to/file on *nix and drive:\path\to\file on Windows
|
[in] | notifier | The callback to inform the client side that the connection has stumbled upon and error and will go reconnecting |
[in] | conn_status_notifier | The callback to inform the client side that the connection status has changed |
[in] | stcn | The callback for informing the client side about the socket thread creation; may be set to NULL if no specific action is required to perform on the client side on a new thread creation |
[in] | stdn | The callback for informing the client side about the socket thread destruction; may be set to NULL if no specific action is required to perform on the client side on a thread destruction |
[in] | user_data | The user defined value passed to the termination notifier callback along with the connection handle; may be set to whatever value |
[out] | connection | The handle of the created connection |
- Returns
- DXF_SUCCESS on successful connection establishment or DXF_FAILURE on error. Created connection is returned via OUT parameter
connection
. dxf_get_last_error can be used to retrieve the error code and description in case of failure.
◆ dxf_create_connection_auth_basic()
Creates connection with the specified parameters and basic authorization.
- Parameters
-
[in] | address | Connection string
- the single address:
host:port or just host
- address with credentials:
host:port[username=xxx,password=yyy]
- multiple addresses:
(host1:port1)(host2)(host3:port3[username=xxx,password=yyy])
- the data from file:
/path/to/file on *nix and drive:\path\to\file on Windows
|
[in] | user | The user name; |
[in] | password | The user password; |
[in] | notifier | The callback to inform the client side that the connection has stumbled upon and error and will go reconnecting |
[in] | conn_status_notifier | The callback to inform the client side that the connection status has changed |
[in] | stcn | The callback for informing the client side about the socket thread creation; may be set to NULL if no specific action is required to perform on the client side on a new thread creation |
[in] | stdn | The callback for informing the client side about the socket thread destruction; may be set to NULL if no specific action is required to perform on the client side on a thread destruction; |
[in] | user_data | The user defined value passed to the termination notifier callback along with the connection handle; may be set to whatever value; |
[out] | connection | The handle of the created connection. |
- Returns
- DXF_SUCCESS on successful connection establishment or DXF_FAILURE on error; created connection is returned via OUT parameter connection; dxf_get_last_error can be used to retrieve the error code and description in case of failure.
- Warning
- The user and password data from argument have a higher priority than address credentials.
◆ dxf_create_connection_auth_bearer()
Creates connection with the specified parameters and token authorization.
- Parameters
-
[in] | address | Connection string
- the single address: "host:port" or just "host"
- address with credentials: "host:port[username=xxx,password=yyy]"
- multiple addresses: "(host1:port1)(host2)(host3:port3[username=xxx,password=yyy])"
- the data from file: "/path/to/file" on *nix and "drive:\path\to\file" on Windows
|
[in] | token | The authorization token; |
[in] | notifier | The callback to inform the client side that the connection has stumbled upon and error and will go reconnecting |
[in] | conn_status_notifier | The callback to inform the client side that the connection status has changed |
[in] | stcn | The callback for informing the client side about the socket thread creation; may be set to NULL if no specific action is required to perform on the client side on a new thread creation |
[in] | stdn | The callback for informing the client side about the socket thread destruction; may be set to NULL if no specific action is required to perform on the client side on a thread destruction; |
[in] | user_data | The user defined value passed to the termination notifier callback along with the connection handle; may be set to whatever value; |
[out] | connection | The handle of the created connection. |
- Returns
- DXF_SUCCESS on successful connection establishment or DXF_FAILURE on error; created connection is returned via OUT parameter connection; dxf_get_last_error can be used to retrieve the error code and description in case of failure.
- Warning
- The token data from argument have a higher priority than address credentials
◆ dxf_create_connection_auth_custom()
Creates connection with the specified parameters and custom described authorization.
- Parameters
-
[in] | address | Connection string
- the single address:
host:port or just host
- address with credentials:
host:port[username=xxx,password=yyy]
- multiple addresses:
(host1:port1)(host2)(host3:port3[username=xxx,password=yyy])
- the data from file:
/path/to/file on *nix and drive:\path\to\file on Windows
|
[in] | authscheme | The authorization scheme |
[in] | authdata | The authorization data |
[in] | notifier | The callback to inform the client side that the connection has stumbled upon and error and will go reconnecting |
[in] | conn_status_notifier | The callback to inform the client side that the connection status has changed |
[in] | stcn | The callback for informing the client side about the socket thread creation; may be set to NULL if no specific action is required to perform on the client side on a new thread creation |
[in] | stdn | The callback for informing the client side about the socket thread destruction; may be set to NULL if no specific action is required to perform on the client side on a thread destruction; |
[in] | user_data | The user defined value passed to the termination notifier callback along with the connection handle; may be set to whatever value; |
[out] | connection | The handle of the created connection. |
- Returns
- DXF_SUCCESS on successful connection establishment or DXF_FAILURE on error; created connection is returned via OUT parameter connection; dxf_get_last_error can be used to retrieve the error code and description in case of failure.
- Warning
- The authscheme and authdata from argument have a higher priority than address credentials.
◆ dxf_free_connection_properties_snapshot()
◆ dxf_get_connection_properties_snapshot()
Retrieves the array of key-value pairs (properties) for specified connection.
The memory for the resulting array is allocated during execution of the function and SHOULD be free by caller with dxf_free_connection_properties_snapshot function. So done because connection properties can be changed during reconnection. Returned array is a snapshot of properties at the moment of the call.
- Parameters
-
[in] | connection | A handle of a previously created connection |
[out] | properties | Address of pointer to store address of key-value pairs array |
[out] | count | Address of variable to store length of key-value pairs array |
- Returns
- DXF_SUCCESS if connection properties have been successfully received or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; properties are returned via output parameter
◆ dxf_get_current_connected_address()
Retrieves the null-terminated string with current connected address in format <host>:<port>
.
If (*address) points to NULL then connection is not connected (reconnection, no valid addresses, closed connection and others). The memory for the resulting string is allocated during execution of the function and SHOULD be free by caller with call of dxf_free function. So done because inner string with connected address can be free during reconnection.
- Parameters
-
[in] | connection | A handle of a previously created connection |
[out] | address | Address of pointer to store address of the null-terminated string with current connected address |
- Returns
- DXF_SUCCESS if address has been successfully received or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; address itself is returned via out parameter
◆ dxf_get_current_connection_status()
Retrieves the current connection status.
- Parameters
-
[in] | connection | A handle of a previously created connection |
[out] | status | Connection status |
- Returns
- DXF_SUCCESS if connection status has been successfully received or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; status itself is returned via out parameter