@@ -33,10 +33,6 @@ pub struct Clients(Arc<Inner>);
3333struct Inner {
3434 /// The list of all currently connected clients.
3535 clients : DashMap < EndpointId , ClientState > ,
36- // /// List of clients that are still connected, but not active anymore
37- // ///
38- // /// Clients are moved here if another endpoint with the same id connects.
39- // inactive_clients: DashMap<EndpointId, Vec<Client>>,
4036 /// Map of which client has sent where
4137 sent_to : DashMap < EndpointId , HashSet < EndpointId > > ,
4238 /// Connection ID Counter
@@ -123,7 +119,6 @@ impl Clients {
123119 self . 0 . clients . remove_if_mut ( & endpoint_id, |_id, state| {
124120 if state. active . connection_id ( ) == connection_id {
125121 // The unregistering client is the currently active client
126- let client = & state. active ;
127122 if let Some ( last_inactive_client) = state. inactive . pop ( ) {
128123 // There is an inactive client, promote to active again.
129124 state. active = last_inactive_client;
@@ -133,7 +128,7 @@ impl Clients {
133128 // No inactive clients: Inform other peers that this peer is now gone.
134129 if let Some ( ( _, sent_to) ) = self . 0 . sent_to . remove ( & endpoint_id) {
135130 for key in sent_to {
136- match client . try_send_peer_gone ( key) {
131+ match state . active . try_send_peer_gone ( key) {
137132 Ok ( _) => { }
138133 Err ( TrySendError :: Full ( _) ) => {
139134 debug ! (
0 commit comments