Non blocking relay connection #44

Merged
CoCo_Sol merged 7 commits from relay-client into main 2024-02-12 14:31:56 +00:00
Showing only changes of commit 2bd5b44179 - Show all commits

View file

@ -242,6 +242,8 @@ impl Connection {
/// This function will connect to the relay server if it's not already
/// connected, and will send and receive messages from the relay server
/// if it's connected.
///
/// This function will not block the current thread.
pub fn update(&mut self) {
self.state = match std::mem::replace(&mut self.state, ConnectionState::Disconnected) {
ConnectionState::Disconnected => self.create_stream(),