gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CADET API: Obtaining the CADET channel closure?


From: Alessio Vanni
Subject: CADET API: Obtaining the CADET channel closure?
Date: Mon, 24 May 2021 22:37:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello,

there might be a better way to do what I'm trying to do, but I couldn't
really think of it, so here it is:

I'm opening CADET channels on demand and then stashing them away until
they are needed again (or closed.) Because those channels require some
"state" when something is received through them, I give them a closure
which is unique for each of them and allocated dynamically at the time
of the channel creation.

When the other end of the channel shuts down or when the service itself
terminates, this closure is deallocated through the disconnect callback.
However, when a channel is closed manually with the `channel_destroy'
function, this closure would linger and never be deallocated as the
callback is not called.

Most of this "state" provided by the closure could actually be provided
in a different way, but the remaining part would be really inefficient
without this closure, so for the sake of avoiding having to continuously
run a for-loop every time certain actions are taken, I'm approaching the
issue this way.

Would it be possible to get that closure somehow? As it is right now
it's impossible, but a way to do it could be added somewhere, if it
makes sense.

I see that there is a function to fetch channel options which currently
returns only the other peer; maybe it could be expanded?

Thanks,
A.V.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]