src: remove raw logging
This commit is contained in:
parent
c80a600845
commit
9dbe2d0f24
|
@ -14,14 +14,9 @@ pub async fn recv(sender: async_std::channel::Sender<Peer>) {
|
|||
let mut old = HashSet::new();
|
||||
|
||||
loop {
|
||||
let (amt, peer) = socket.recv_from(&mut buf).await.unwrap();
|
||||
let (amt, _) = socket.recv_from(&mut buf).await.unwrap();
|
||||
let buf = &mut buf[..amt];
|
||||
let packet = String::from_utf8(buf.to_vec()).unwrap();
|
||||
println!(
|
||||
"{} {}",
|
||||
peer,
|
||||
Peer::from_discovery_packet(&packet).to_discovery_packet()
|
||||
);
|
||||
let peer = Peer::from_discovery_packet(packet.as_str());
|
||||
if !old.contains(&peer) {
|
||||
old.insert(peer.clone());
|
||||
|
@ -47,7 +42,6 @@ pub async fn send(pubkey: Arc<String>) {
|
|||
socket.set_broadcast(true).unwrap();
|
||||
|
||||
loop {
|
||||
println!("Sending packet: {:?}", &msg);
|
||||
socket.send_to(&buf, "255.255.255.255:8008").await.unwrap();
|
||||
socket.send_to(&buf, "[FF02::1]:8008").await.unwrap();
|
||||
task::sleep(std::time::Duration::from_secs(1)).await;
|
||||
|
|
|
@ -35,7 +35,6 @@ async fn main() {
|
|||
},
|
||||
};
|
||||
let keypair = Keypair::read_or_generate(path.join("secret")).await;
|
||||
println!("{}", keypair.to_json().pretty(2));
|
||||
|
||||
let (psend, precv) = async_std::channel::unbounded();
|
||||
task::spawn(async move { discovery::recv(psend).await });
|
||||
|
|
Loading…
Reference in New Issue