[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C API: Query regarding Speech Dispatcher Callbacks and State Managem
From: |
Samuel Thibault |
Subject: |
Re: C API: Query regarding Speech Dispatcher Callbacks and State Management |
Date: |
Sun, 17 Sep 2023 10:09:42 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Day Garwood, le dim. 17 sept. 2023 08:58:22 +0100, a ecrit:
> The challenge I'm facing is that to retrieve the client ID, I'd need access
> to the connection.
Yes, but you can do that before the callback, when you are creating the
connection and adding callbacks to it.
Within the callback you have the client_id as parameter.
> void init(struct my_state* state)
>
> {
>
> state->connection=spd_connect("myapp", "myclient", NULL, SPD_MODE_THREADED);
So use spd_get_client_id here. And use some global table that
associations the clien_id to your state structure.
Samuel