How to keep SocketConnection open between threads?

I have some async function that read InputSream chunks from SocketConnection, but on next read iteration, connection get close.

This problem could be fixed when I delegate Connection with InputStream to the function, where increasing reference count. Without Connection share, it closing.

Please try to use the right tags while creating a topic in discourse.

Discourse users will be notified by e-mail on tags they watch for.

1 Like

Seems my issue related with memory management in Rust - it drop the connection because destroy last reference in active thread. so as the solution maybe I must delegate this Connection reference everywhere to keep it alive.

Maybe it works in C without any problems. I’ve just expected that Connection reference will be holded on GTK side as long as last Stream reference alive, but seems that is different objects, not related with each other.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.