feat: add missing message handlers

This commit is contained in:
michel
2024-09-13 20:58:04 +02:00
committed by Michel de Graaf
parent 6281b0c89e
commit 10f4a34ae4
34 changed files with 1889 additions and 564 deletions
+14 -7
View File
@@ -1,23 +1,30 @@
mod client;
mod dispatcher;
mod message;
mod peer;
mod server;
use std::thread;
mod utils;
use client::Client;
use server::ServerAddress;
use server::PeerAddress;
use std::time::Duration;
fn main() {
let client = Client::new(
let mut client = Client::new(
// ServerAddress::new(String::from("localhost"), 2416),
ServerAddress::new(String::from("server.slsknet.org"), 2416),
PeerAddress::new(String::from("server.slsknet.org"), 2416),
String::from("insane_in_the_brain2"),
// String::from("invalid"),
String::from("13375137"),
);
client.connect();
loop {
thread::park();
match client.login() {
Ok(_) => {
client.search("the weekend", Duration::from_secs(20));
}
Err(e) => {
println!("Failed to login: {}", e);
}
}
}