chore: make message handlers and dispatcher generic
This commit is contained in:
+5
-3
@@ -9,11 +9,13 @@ use client::Client;
|
||||
use server::PeerAddress;
|
||||
use std::time::Duration;
|
||||
|
||||
// PeerAddress::new(String::from("server.slsknet.org"), 2416),
|
||||
fn main() {
|
||||
let mut client = Client::new(
|
||||
// ServerAddress::new(String::from("localhost"), 2416),
|
||||
PeerAddress::new(String::from("server.slsknet.org"), 2416),
|
||||
String::from("insane_in_the_brain2"),
|
||||
// PeerAddress::new(String::from("127.0.0.1"), 2242),
|
||||
PeerAddress::new(String::from("server.slsknet.org"), 2242),
|
||||
String::from("insane_in_the_brain3"),
|
||||
// String::from("invalid"),
|
||||
String::from("13375137"),
|
||||
);
|
||||
@@ -21,7 +23,7 @@ fn main() {
|
||||
client.connect();
|
||||
match client.login() {
|
||||
Ok(_) => {
|
||||
client.search("the weekend", Duration::from_secs(20));
|
||||
client.search("Fantazia", Duration::from_secs(20));
|
||||
}
|
||||
Err(e) => {
|
||||
println!("Failed to login: {}", e);
|
||||
|
||||
Reference in New Issue
Block a user