feat: add missing message handlers
This commit is contained in:
+14
-7
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user