Changes to be committed:
modified: src/main.rs modified: src/server.rs
This commit is contained in:
parent
96f757e2c7
commit
c7ce492934
@ -78,7 +78,7 @@ struct ServerInterface {
|
|||||||
keepalive: u8
|
keepalive: u8
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
||||||
pub struct ServerPeer {
|
pub struct ServerPeer {
|
||||||
public_key: String,
|
public_key: String,
|
||||||
ip: Ipv4Addr
|
ip: Ipv4Addr
|
||||||
|
@ -68,6 +68,10 @@ pub async fn server_mode(server_config: ServerConfiguration) {
|
|||||||
let addrs_lp = addresses.clone();
|
let addrs_lp = addresses.clone();
|
||||||
let peers_lp = peers.clone();
|
let peers_lp = peers.clone();
|
||||||
|
|
||||||
|
let mut f_plp = peers_lp.lock().await;
|
||||||
|
server_config.peers.iter().for_each(|c| f_plp.push(c.clone()));
|
||||||
|
drop(f_plp);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if let Ok((len, addr)) = sock_rec.recv_from(&mut buf).await {
|
if let Ok((len, addr)) = sock_rec.recv_from(&mut buf).await {
|
||||||
let mut mp = addrs_lp.lock().await;
|
let mut mp = addrs_lp.lock().await;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user