port changing functionality (#34)

* port changing functionality

* add portchange to cli frontend
This commit is contained in:
Ferdinand Schober
2023-10-17 15:12:17 +02:00
committed by GitHub
parent 60a73b3cb0
commit e88241e816
9 changed files with 263 additions and 121 deletions

View File

@@ -33,14 +33,16 @@ pub enum FrontendEvent {
AddClient(Option<String>, u16, Position),
/// activate/deactivate client
ActivateClient(ClientHandle, bool),
/// update a client (hostname, port, position)
UpdateClient(ClientHandle, Option<String>, u16, Position),
/// change the listen port (recreate udp listener)
ChangePort(u16),
/// remove a client
DelClient(ClientHandle),
/// request an enumertaion of all clients
Enumerate(),
/// service shutdown
Shutdown(),
/// update a client (hostname, port, position)
UpdateClient(ClientHandle, Option<String>, u16, Position),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -48,6 +50,8 @@ pub enum FrontendNotify {
NotifyClientCreate(ClientHandle, Option<String>, u16, Position),
NotifyClientUpdate(ClientHandle, Option<String>, u16, Position),
NotifyClientDelete(ClientHandle),
/// new port, reason of failure (if failed)
NotifyPortChange(u16, Option<String>),
Enumerate(Vec<(Client, bool)>),
NotifyError(String),
}