|
dxFeed Graal Native SDK 3.14.0-rc2
|
The message connectors of an endpoint: their state, addresses and statistics. More...
Data Structures | |
| The handle of a message connector (dxfg_v4_DXEndpoint_getConnectors()). More... | |
| A list of message connectors (dxfg_v4_DXEndpoint_getConnectors()). More... | |
| The statistics of a message connector (dxfg_v4_MessageConnector_getStatistics()). More... | |
| The handle of a listener of the state changes of the message connectors of an endpoint (dxfg_v4_MessageConnectorListener_new()). More... | |
| struct | dxfg_v4_connection_error_t |
| A connection error of a message connector (dxfg_v4_MessageConnector_getLastError(), dxfg_v4_DXEndpoint_getLastConnectionError()). More... | |
Macros | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_KIND_CLIENT_SOCKET ((int32_t)0) |
| The kind of a message connector: a client socket connector (an address host:port). | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_KIND_SERVER_SOCKET ((int32_t)1) |
| The kind of a message connector: a server socket connector (an address :port). | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_KIND_OTHER ((int32_t)2) |
| The kind of a message connector: any other connector (a file, a non-blocking or a custom connector). | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTING ((int32_t)0) |
| The state of a message connector: started, not connected yet, or reconnecting after a failure or a drop. | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTED ((int32_t)1) |
| The state of a message connector: at least one of its connections is established (a server socket connector: it accepts connections). | |
| #define | DXFG_V4_MESSAGE_CONNECTOR_STATE_DISCONNECTED ((int32_t)2) |
| The state of a message connector: stopped, e.g. replaced by a connect to another address, or its endpoint disconnected or closed. | |
| #define | DXFG_V4_CONNECTION_ERROR_OTHER ((int32_t)0) |
| The category of a connection error: none of the others (e.g. an error of the protocol or of the authentication). | |
| #define | DXFG_V4_CONNECTION_ERROR_DNS ((int32_t)1) |
| The category of a connection error: the host name of the address is not resolved (Java: java.net.UnknownHostException). | |
| #define | DXFG_V4_CONNECTION_ERROR_CONNECT_FAILED ((int32_t)2) |
| The category of a connection error: the connect failed, refused or timed out; QD reports both with one exception type (Java: java.net.ConnectException, NoRouteToHostException, PortUnreachableException). | |
| #define | DXFG_V4_CONNECTION_ERROR_READ_TIMEOUT ((int32_t)3) |
| The category of a connection error: a read of an established connection timed out (Java: java.net.SocketTimeoutException). | |
| #define | DXFG_V4_CONNECTION_ERROR_HEARTBEAT_TIMEOUT ((int32_t)4) |
| The category of a connection error: the remote side sent no data and no heartbeat within the heartbeat timeout (the address option [heartbeatTimeout=...]), so QD closed the connection; the error has no exception. | |
| #define | DXFG_V4_CONNECTION_ERROR_CLOSED_BY_REMOTE ((int32_t)5) |
| The category of a connection error: the remote side closed the connection (Java: java.io.EOFException). | |
| #define | DXFG_V4_CONNECTION_ERROR_TLS ((int32_t)6) |
| The category of a connection error: the TLS handshake or a TLS record failed, e.g. a tls+ address of a port without TLS or a certificate that is not trusted (Java: javax.net.ssl.SSLException). | |
| #define | DXFG_V4_CONNECTION_ERROR_IO ((int32_t)7) |
| The category of a connection error: another I/O error, e.g. a connection reset (Java: java.io.IOException). | |
Typedefs | |
| typedef struct dxfg_v4_message_connector_t | dxfg_v4_message_connector_t |
| The handle of a message connector (dxfg_v4_DXEndpoint_getConnectors()). | |
| typedef struct dxfg_v4_message_connector_list | dxfg_v4_message_connector_list |
| A list of message connectors (dxfg_v4_DXEndpoint_getConnectors()). | |
| typedef struct dxfg_v4_message_connector_stats_t | dxfg_v4_message_connector_stats_t |
| The statistics of a message connector (dxfg_v4_MessageConnector_getStatistics()). | |
| typedef struct dxfg_v4_message_connector_listener_t | dxfg_v4_message_connector_listener_t |
| The handle of a listener of the state changes of the message connectors of an endpoint (dxfg_v4_MessageConnectorListener_new()). | |
| typedef void(*) | dxfg_v4_message_connector_listener_func(graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, void *user_data) |
| The function of a listener of the state changes of the message connectors of an endpoint (dxfg_v4_MessageConnectorListener_new()). | |
| typedef struct dxfg_v4_connection_error_t | dxfg_v4_connection_error_t |
| A connection error of a message connector (dxfg_v4_MessageConnector_getLastError(), dxfg_v4_DXEndpoint_getLastConnectionError()). | |
Functions | |
| int32_t | dxfg_v4_DXEndpoint_getConnectors (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, DXFG_OUT dxfg_v4_message_connector_list **connectors) |
| Returns the current message connectors of an endpoint. | |
| int32_t | dxfg_v4_message_connector_list_release (graal_isolatethread_t *thread, dxfg_v4_message_connector_list *connectors) |
| Releases a list of message connectors: every connector handle of the list, its array of elements and the list itself. | |
| int32_t | dxfg_v4_MessageConnector_getName (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT const char **name) |
| Returns the name of a message connector, as in QD's log and JMX (e.g. ClientSocket-Distributor). | |
| int32_t | dxfg_v4_MessageConnector_getKind (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT int32_t *kind) |
| Returns the kind of a message connector. | |
| int32_t | dxfg_v4_MessageConnector_getAddress (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT const char **address) |
| Returns the address a message connector was configured with (e.g. 127.0.0.1:7300, :7400), the user and the password masked as in QD's log. | |
| int32_t | dxfg_v4_MessageConnector_getCurrentAddresses (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT dxfg_v4_string_list **addresses) |
| Returns the host:port addresses a client socket connector is connected to now, one per connected connection (a striped connector has several). | |
| int32_t | dxfg_v4_MessageConnector_getState (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT int32_t *state) |
| Returns the state of a message connector. | |
| int32_t | dxfg_v4_MessageConnector_isActive (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT int32_t *active) |
| Checks whether a message connector is started (it connects or reconnects), as opposed to stopped. | |
| int32_t | dxfg_v4_MessageConnector_getConnectionCount (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT int32_t *count) |
| Returns the number of the open connections of a message connector: those of a client socket connector (more than one for a striped connector) or those that a server socket connector accepted. | |
| int32_t | dxfg_v4_MessageConnector_getClosedConnectionCount (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT int64_t *count) |
| Returns the number of the connections of a message connector closed since it was created: it grows on each drop and on each reconnect. | |
| int32_t | dxfg_v4_MessageConnector_getStatistics (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT dxfg_v4_message_connector_stats_t *stats) |
| Reads the statistics of a message connector: the bytes and data records read and written, the open and the closed connections. | |
| int32_t | dxfg_v4_MessageConnectorListener_new (graal_isolatethread_t *thread, dxfg_v4_message_connector_listener_func user_func, void *user_data, DXFG_OUT dxfg_v4_message_connector_listener_t **listener) |
| Creates a new listener of the state changes of the message connectors of an endpoint. | |
| int32_t | dxfg_v4_DXEndpoint_addMessageConnectorListener (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, dxfg_v4_message_connector_listener_t *listener) |
| Adds a listener of the state changes of the message connectors to an endpoint. | |
| int32_t | dxfg_v4_DXEndpoint_removeMessageConnectorListener (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, dxfg_v4_message_connector_listener_t *listener) |
| Removes a listener of the state changes of the message connectors from an endpoint. | |
| int32_t | dxfg_v4_MessageConnector_getLastError (graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, DXFG_OUT dxfg_v4_connection_error_t **error) |
| Returns the last connection error of a message connector: the newest failed connect or dropped connection. | |
| int32_t | dxfg_v4_DXEndpoint_getLastConnectionError (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, DXFG_OUT dxfg_v4_connection_error_t **error) |
| Returns the last connection error of an endpoint: the newest error of all its connectors. | |
| int32_t | dxfg_v4_ConnectionError_release (graal_isolatethread_t *thread, dxfg_v4_connection_error_t *error) |
| Releases a connection error and its strings. | |
The message connectors of an endpoint: their state, addresses and statistics.
An endpoint connected with dxfg_v4_DXEndpoint_connect() has one message connector per address of the address string (e.g. two for (host1:7300)(host2:7300)): a client socket connector for host:port, a server socket connector for :port, or another kind (a file, a non-blocking or a custom connector). dxfg_v4_DXEndpoint_getConnectors() returns the current connectors of the endpoint; each call reads them anew. A connect to another address replaces the connectors: the new list has new connectors, and a replaced one still answers, as DXFG_V4_MESSAGE_CONNECTOR_STATE_DISCONNECTED. A connect to the same address and dxfg_v4_DXEndpoint_reconnect() keep the connectors.
Each value of a connector is current when it is read; the values are not read together as one consistent set. Reading them changes nothing: the statistics are not reset, and other readers (QD's JMX beans) see the same values.
A connector handle is released with dxfg_v4_JavaObjectHandler_release() and a list of them with dxfg_v4_message_connector_list_release(); dxfg_v4_JavaObjectHandler_clone() keeps a connector of a list after the list is released. The handles and the lists can be released in any order, also after the endpoint is closed.
A listener (dxfg_v4_MessageConnectorListener_new(), experimental) added to an endpoint with dxfg_v4_DXEndpoint_addMessageConnectorListener() is called after the state changes of its connectors, also of the connectors that a later connect creates.
The last connection error of a connector (dxfg_v4_MessageConnector_getLastError(), experimental) and of an endpoint (dxfg_v4_DXEndpoint_getLastConnectionError()) tells why a connect failed or a connection dropped: the time, the address, a category (DXFG_V4_CONNECTION_ERROR_CONNECT_FAILED and others), the exception and its message. The SDK captures the errors from the log records of QD's default logging (java.util.logging), whether or not a logging listener is set and at any log.level. With another log.className nothing is captured, and a level the user sets on QD's loggers com.devexperts.qd.qtp.MessageConnector, com.devexperts.qd.qtp.MessageAdapterConnection or com.devexperts.connector.codec.ssl themselves wins and may stop the capture.
DXFG_V4_FEATURE_MESSAGE_CONNECTORS reports the functions of the group except the connection errors, which DXFG_V4_FEATURE_CONNECTION_ERRORS reports.
Java: com.devexperts.qd.qtp.MessageConnector of com.dxfeed.api.impl.DXEndpointImpl.getQDEndpoint().
| #define DXFG_V4_CONNECTION_ERROR_CLOSED_BY_REMOTE ((int32_t)5) |
The category of a connection error: the remote side closed the connection (Java: java.io.EOFException).
| #define DXFG_V4_CONNECTION_ERROR_CONNECT_FAILED ((int32_t)2) |
The category of a connection error: the connect failed, refused or timed out; QD reports both with one exception type (Java: java.net.ConnectException, NoRouteToHostException, PortUnreachableException).
| #define DXFG_V4_CONNECTION_ERROR_DNS ((int32_t)1) |
The category of a connection error: the host name of the address is not resolved (Java: java.net.UnknownHostException).
| #define DXFG_V4_CONNECTION_ERROR_HEARTBEAT_TIMEOUT ((int32_t)4) |
The category of a connection error: the remote side sent no data and no heartbeat within the heartbeat timeout (the address option [heartbeatTimeout=...]), so QD closed the connection; the error has no exception.
| #define DXFG_V4_CONNECTION_ERROR_IO ((int32_t)7) |
The category of a connection error: another I/O error, e.g. a connection reset (Java: java.io.IOException).
| #define DXFG_V4_CONNECTION_ERROR_OTHER ((int32_t)0) |
The category of a connection error: none of the others (e.g. an error of the protocol or of the authentication).
New categories may come in later versions: treat an unknown value as this one.
| #define DXFG_V4_CONNECTION_ERROR_READ_TIMEOUT ((int32_t)3) |
The category of a connection error: a read of an established connection timed out (Java: java.net.SocketTimeoutException).
| #define DXFG_V4_CONNECTION_ERROR_TLS ((int32_t)6) |
The category of a connection error: the TLS handshake or a TLS record failed, e.g. a tls+ address of a port without TLS or a certificate that is not trusted (Java: javax.net.ssl.SSLException).
| #define DXFG_V4_MESSAGE_CONNECTOR_KIND_CLIENT_SOCKET ((int32_t)0) |
The kind of a message connector: a client socket connector (an address host:port).
| #define DXFG_V4_MESSAGE_CONNECTOR_KIND_OTHER ((int32_t)2) |
The kind of a message connector: any other connector (a file, a non-blocking or a custom connector).
New kinds may be added; an application treats an unknown value as this one.
| #define DXFG_V4_MESSAGE_CONNECTOR_KIND_SERVER_SOCKET ((int32_t)1) |
The kind of a message connector: a server socket connector (an address :port).
| #define DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTED ((int32_t)1) |
The state of a message connector: at least one of its connections is established (a server socket connector: it accepts connections).
Java: MessageConnectorState.CONNECTED.
| #define DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTING ((int32_t)0) |
The state of a message connector: started, not connected yet, or reconnecting after a failure or a drop.
Java: MessageConnectorState.CONNECTING.
| #define DXFG_V4_MESSAGE_CONNECTOR_STATE_DISCONNECTED ((int32_t)2) |
The state of a message connector: stopped, e.g. replaced by a connect to another address, or its endpoint disconnected or closed.
Java: MessageConnectorState.DISCONNECTED.
| typedef struct dxfg_v4_connection_error_t dxfg_v4_connection_error_t |
A connection error of a message connector (dxfg_v4_MessageConnector_getLastError(), dxfg_v4_DXEndpoint_getLastConnectionError()).
A copy: it does not change when the connector records a newer error. The SDK allocates it with its strings: release it with dxfg_v4_ConnectionError_release().
| typedef struct dxfg_v4_message_connector_list dxfg_v4_message_connector_list |
A list of message connectors (dxfg_v4_DXEndpoint_getConnectors()).
The SDK allocates it with its array of elements and the elements: release it with dxfg_v4_message_connector_list_release().
| typedef void(*) dxfg_v4_message_connector_listener_func(graal_isolatethread_t *thread, dxfg_v4_message_connector_t *connector, void *user_data) |
The function of a listener of the state changes of the message connectors of an endpoint (dxfg_v4_MessageConnectorListener_new()).
It is called after the state of a connector of an endpoint to which the listener is added has changed: it connected, lost its connection, started to reconnect, or was replaced or closed. The function reads the current values of the connector (dxfg_v4_MessageConnector_getState() and the other getters); fast changes of one connector may come as one call. It is called on one thread of the SDK for all the listeners of the isolate (named dxfg-MessageConnectorListener), never on a QD thread and never within the call that changes the state (e.g. dxfg_v4_DXEndpoint_connect()), one call at a time. The function may call any function of the SDK on that thread, including dxfg_v4_DXEndpoint_connect() of its endpoint, the getters of the connector and the release of its own listener; it should return quickly, since the next call waits for it. When the change is a connection error, the error is recorded before the call: dxfg_v4_MessageConnector_getLastError() returns it in the call already.
| [in] | thread | The current GraalVM Isolate's thread (the thread of the SDK that calls the function). |
| [in] | connector | The connector whose state changed. The handle is valid during the call only and is released by the SDK; dxfg_v4_JavaObjectHandler_clone() keeps the connector after the call. |
| [in] | user_data | The user data given to dxfg_v4_MessageConnectorListener_new(). |
| typedef struct dxfg_v4_message_connector_listener_t dxfg_v4_message_connector_listener_t |
The handle of a listener of the state changes of the message connectors of an endpoint (dxfg_v4_MessageConnectorListener_new()).
| typedef struct dxfg_v4_message_connector_stats_t dxfg_v4_message_connector_stats_t |
The statistics of a message connector (dxfg_v4_MessageConnector_getStatistics()).
The counters cover all the connections of the connector since it was created, the closed ones included. The layout of the struct does not change: new counters will come with a new function.
On iOS and the iOS Simulator, read_data_records and written_data_records stay 0: the SDK of these platforms has no QD monitoring (qds-monitoring), which keeps the statistics they come from. The other counters work there too.
| typedef struct dxfg_v4_message_connector_t dxfg_v4_message_connector_t |
The handle of a message connector (dxfg_v4_DXEndpoint_getConnectors()).
| int32_t dxfg_v4_ConnectionError_release | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_connection_error_t * | error ) |
Releases a connection error and its strings.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | error | The error (dxfg_v4_MessageConnector_getLastError(), dxfg_v4_DXEndpoint_getLastConnectionError()); NULL is a no-op. |
| int32_t dxfg_v4_DXEndpoint_addMessageConnectorListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_endpoint_t * | endpoint, | ||
| dxfg_v4_message_connector_listener_t * | listener ) |
Adds a listener of the state changes of the message connectors to an endpoint.
The listener gets the changes of the current connectors of the endpoint and of the connectors that a later dxfg_v4_DXEndpoint_connect() creates; it does not get the current states at the add, so read them with dxfg_v4_DXEndpoint_getConnectors() after it. Adding a listener that is added already changes nothing. One listener may be added to several endpoints.
Java: QDEndpoint.addMessageConnectionListener(MessageConnectorListener).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The endpoint; must not be NULL. |
| [in] | listener | The listener; must not be NULL. |
| int32_t dxfg_v4_DXEndpoint_getConnectors | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_endpoint_t * | endpoint, | ||
| DXFG_OUT dxfg_v4_message_connector_list ** | connectors ) |
Returns the current message connectors of an endpoint.
Each call reads the connectors anew, so the connectors replaced by a connect to another address are never returned. The list is empty for an endpoint that is not connected, that has the role LOCAL_HUB, or that is closed.
Java: QDEndpoint.getConnectors().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The endpoint; must not be NULL. |
| [out] | connectors | The pointer to the variable that receives the list (release it with dxfg_v4_message_connector_list_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXEndpoint_getLastConnectionError | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_endpoint_t * | endpoint, | ||
| DXFG_OUT dxfg_v4_connection_error_t ** | error ) |
Returns the last connection error of an endpoint: the newest error of all its connectors.
The error stays after a connect to another address replaced the connector that recorded it, and after the endpoint is closed; a successful connection clears nothing.
Read the error in the connector listener (dxfg_v4_DXEndpoint_addMessageConnectorListener()), which is called after the error is recorded. The state change listener of the endpoint (dxfg_v4_DXEndpoint_addStateChangeListener()) gives no such order: QD computes the endpoint state on another thread, so the listener may be called before the error of that change is recorded; compare the time or the count of the error with those seen before. Failed connect attempts do not change the endpoint state at all: the endpoint stays connecting between them.
Java: no counterpart; the SDK captures the errors from QD's log records.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The endpoint; must not be NULL. |
| [out] | error | The pointer to the variable that receives the error (release it with dxfg_v4_ConnectionError_release()), or NULL when the endpoint has had no error; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXEndpoint_removeMessageConnectorListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_endpoint_t * | endpoint, | ||
| dxfg_v4_message_connector_listener_t * | listener ) |
Removes a listener of the state changes of the message connectors from an endpoint.
Removing a listener that is not added is no error. A call of the function that is already running finishes; to wait until no call runs, release the listener.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The endpoint; must not be NULL. |
| [in] | listener | The listener; must not be NULL. |
| int32_t dxfg_v4_message_connector_list_release | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_list * | connectors ) |
Releases a list of message connectors: every connector handle of the list, its array of elements and the list itself.
The connectors cloned from the list with dxfg_v4_JavaObjectHandler_clone() stay valid.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connectors | The list (dxfg_v4_DXEndpoint_getConnectors()); NULL is a no-op. |
| int32_t dxfg_v4_MessageConnector_getAddress | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT const char ** | address ) |
Returns the address a message connector was configured with (e.g. 127.0.0.1:7300, :7400), the user and the password masked as in QD's log.
Java: MessageConnector.getAddress(), LogUtil.hideCredentials(Object).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | address | The pointer to the variable that receives the address (release it with dxfg_v4_String_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getClosedConnectionCount | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT int64_t * | count ) |
Returns the number of the connections of a message connector closed since it was created: it grows on each drop and on each reconnect.
Java: MessageConnector.getClosedConnectionCount().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | count | The pointer to the variable that receives the number; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getConnectionCount | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT int32_t * | count ) |
Returns the number of the open connections of a message connector: those of a client socket connector (more than one for a striped connector) or those that a server socket connector accepted.
Java: MessageConnector.getConnectionCount().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | count | The pointer to the variable that receives the number; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getCurrentAddresses | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT dxfg_v4_string_list ** | addresses ) |
Returns the host:port addresses a client socket connector is connected to now, one per connected connection (a striped connector has several).
The list is empty when the connector is not connected, and always empty for the other kinds of connectors.
Java: ClientSocketConnector.getCurrentAddresses().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | addresses | The pointer to the variable that receives the list of the addresses (release it with dxfg_v4_string_list_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getKind | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT int32_t * | kind ) |
Returns the kind of a message connector.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | kind | The pointer to the variable that receives the kind: DXFG_V4_MESSAGE_CONNECTOR_KIND_CLIENT_SOCKET, DXFG_V4_MESSAGE_CONNECTOR_KIND_SERVER_SOCKET or DXFG_V4_MESSAGE_CONNECTOR_KIND_OTHER; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getLastError | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT dxfg_v4_connection_error_t ** | error ) |
Returns the last connection error of a message connector: the newest failed connect or dropped connection.
A successful connection clears nothing: the time tells how old the error is. The SDK watches the connectors of the endpoints it creates from their creation; a connector of another endpoint has no errors.
Java: no counterpart; the SDK captures the errors from QD's log records.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | error | The pointer to the variable that receives the error (release it with dxfg_v4_ConnectionError_release()), or NULL when the connector has had no error; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getName | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT const char ** | name ) |
Returns the name of a message connector, as in QD's log and JMX (e.g. ClientSocket-Distributor).
The connectors of different endpoints may have the same name.
Java: MessageConnector.getName().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | name | The pointer to the variable that receives the name (release it with dxfg_v4_String_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getState | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT int32_t * | state ) |
Returns the state of a message connector.
Java: MessageConnector.getState().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | state | The pointer to the variable that receives the state: DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTING, DXFG_V4_MESSAGE_CONNECTOR_STATE_CONNECTED or DXFG_V4_MESSAGE_CONNECTOR_STATE_DISCONNECTED; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_getStatistics | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT dxfg_v4_message_connector_stats_t * | stats ) |
Reads the statistics of a message connector: the bytes and data records read and written, the open and the closed connections.
Nothing is reset: other readers of QD's statistics see the same values. Data arrives when read_data_records grows between two calls; read_bytes grows on heartbeats too. On iOS and the iOS Simulator the data record counters stay 0 (see dxfg_v4_message_connector_stats_t).
Java: MessageConnector.retrieveCompleteEndpointStats(), and QDStats.getValue(SValue) of MessageConnector.getStats() with IO_DATA_READ_RECORDS and IO_DATA_WRITE_RECORDS.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | stats | The pointer to the structure that receives the statistics; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnector_isActive | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_t * | connector, | ||
| DXFG_OUT int32_t * | active ) |
Checks whether a message connector is started (it connects or reconnects), as opposed to stopped.
Java: MessageConnector.isActive().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | connector | The connector; must not be NULL. |
| [out] | active | The pointer to the variable that receives 1 if the connector is started, 0 otherwise; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_MessageConnectorListener_new | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_message_connector_listener_func | user_func, | ||
| void * | user_data, | ||
| DXFG_OUT dxfg_v4_message_connector_listener_t ** | listener ) |
Creates a new listener of the state changes of the message connectors of an endpoint.
The listener does nothing until it is added to an endpoint with dxfg_v4_DXEndpoint_addMessageConnectorListener(). The function is called as described at dxfg_v4_message_connector_listener_func.
Releasing the last handle of the listener with dxfg_v4_JavaObjectHandler_release() (or dxfg_v4_NativeListener_deactivate(), or dxfg_v4_NativeListener_deactivateAll()) stops the calls of the function: after the release returns the function is not running (except on the releasing thread itself, when the function releases its own listener) and is not called anymore, so the user data can be freed. A released listener that is still added removes itself from the endpoint at the next state change of a connector.
Java: com.devexperts.qd.qtp.MessageConnectorListener.stateChanged(MessageConnector), called on a thread of the SDK.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | user_func | The function to call after the state changes; must not be NULL. |
| [in] | user_data | The user data to pass to the function; the SDK does not use it. It must stay valid until the listener is deactivated. |
| [out] | listener | The pointer to the variable that receives the listener (release its handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |