td_json_client class
td_json_client.h File Reference.
Constructors
- td_json_client(DynamicLibrary dynamicLibrary)
-
The symbols are looked up in
dynamicLibrary
. -
td_json_client.fromLookup(Pointer<
T> lookup(String symbolName)) -
The symbols are looked up with
lookup
.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
td_create_client_id(
) → int - Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it. \return Opaque identifier of a new TDLib instance.
-
td_execute(
Pointer< Utf8> request) → Pointer<Utf8> -
Synchronously executes a TDLib request.
A request can be executed synchronously, only if it is documented with "Can be called synchronously".
The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib.
\param
in
request JSON-serialized null-terminated request to TDLib. \return JSON-serialized null-terminated request response. -
td_json_client_create(
) → Pointer< Void> - Creates a new instance of TDLib. \return Pointer to the created instance of TDLib.
-
td_json_client_destroy(
Pointer< Void> client) → void -
Destroys the TDLib client instance. After this is called the client instance must not be used anymore.
\param
in
client The client. -
td_json_client_execute(
Pointer< Void> client, Pointer<Utf8> request) → Pointer<Utf8> -
Synchronously executes TDLib request. May be called from any thread.
Only a few requests can be executed synchronously.
Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute
in the same thread, so it can't be used after that.
\param
in
client The client. Currently ignored for all requests, so NULL can be passed. \paramin
request JSON-serialized null-terminated request to TDLib. \return JSON-serialized null-terminated request response. -
td_json_client_receive(
Pointer< Void> client, double timeout) → Pointer<Utf8> -
Receives incoming updates and request responses from the TDLib client. May be called from any thread, but
must not be called simultaneously from two different threads.
Returned pointer will be deallocated by TDLib during next call to td_json_client_receive or td_json_client_execute
in the same thread, so it can't be used after that.
\param
in
client The client. \paramin
timeout The maximum number of seconds allowed for this function to wait for new data. \return JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires. -
td_json_client_send(
Pointer< Void> client, Pointer<Utf8> request) → void -
Sends request to the TDLib client. May be called from any thread.
\param
in
client The client. \paramin
request JSON-serialized null-terminated request to TDLib. -
td_receive(
double timeout) → Pointer< Utf8> -
Receives incoming updates and request responses. Must not be called simultaneously from two different threads.
The returned pointer can be used until the next call to td_receive or td_execute, after which it will be deallocated by TDLib.
\param
in
timeout The maximum number of seconds allowed for this function to wait for new data. \return JSON-serialized null-terminated incoming update or request response. May be NULL if the timeout expires. -
td_send(
int client_id, Pointer< Utf8> request) → void -
Sends request to the TDLib client. May be called from any thread.
\param
in
client_id TDLib client identifier. \paramin
request JSON-serialized null-terminated request to TDLib. -
td_set_log_message_callback(
int max_verbosity_level, td_log_message_callback_ptr callback) → void - Sets the callback that will be called when a message is added to the internal TDLib log. None of the TDLib methods can be called from the callback. By default the callback is not set.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited