Skip to content
Snippets Groups Projects
Commit 899a6b25 authored by Louis's avatar Louis :fire:
Browse files

Add 'close' to EventClient and PollingClient

parent cbac59df
No related branches found
No related tags found
1 merge request!1Close Connection
......@@ -203,6 +203,10 @@ impl PollingClient {
pub fn send_binary(&self, message: Vec<u8>) -> Result<(), JsValue> {
self.event_client.send_binary(message)
}
pub fn close(&self) -> Result<(), JsValue> {
self.event_client.close();
}
}
#[derive(Debug, Clone, Error)]
......@@ -435,4 +439,8 @@ impl EventClient {
.borrow()
.send_with_u8_array(message.as_slice())
}
pub fn close(&self) -> Result<(), JsValue> {
self.connection.borrow().close()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment