equal
deleted
inserted
replaced
186 if !sender.send(Message(message)).await { |
186 if !sender.send(Message(message)).await { |
187 break; |
187 break; |
188 } |
188 } |
189 } |
189 } |
190 Err(e) => { |
190 Err(e) => { |
|
191 todo!("send cmdline errors"); |
191 sender.send(Error(format!("{}", e))).await; |
192 sender.send(Error(format!("{}", e))).await; |
192 if matches!(e, ProtocolError::Timeout) { |
193 if matches!(e, ProtocolError::Timeout) { |
193 Self::write(&mut self.stream, Bytes::from(HwServerMessage::Bye("Ping timeout".to_string()).to_raw_protocol())).await; |
194 Self::write(&mut self.stream, Bytes::from(HwServerMessage::Bye("Ping timeout".to_string()).to_raw_protocol())).await; |
194 } |
195 } |
195 break; |
196 break; |
274 } |
275 } |
275 None => unreachable!(), |
276 None => unreachable!(), |
276 } |
277 } |
277 } |
278 } |
278 |
279 |
|
280 todo!("add the DB task"); |
|
281 todo!("add certfile watcher task"); |
279 loop { |
282 loop { |
280 #[cfg(not(feature = "tls-connections"))] |
283 #[cfg(not(feature = "tls-connections"))] |
281 tokio::select! { |
284 tokio::select! { |
282 Ok(value) = self.listener.accept() => accept_plain_branch(self, value, update_tx.clone()).await, |
285 Ok(value) = self.listener.accept() => accept_plain_branch(self, value, update_tx.clone()).await, |
283 client_message = update_rx.recv(), if !self.clients.is_empty() => client_message_branch(self, client_message).await |
286 client_message = update_rx.recv(), if !self.clients.is_empty() => client_message_branch(self, client_message).await |