aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: d49627057f0c0c263faacf65fa9439e79c465efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
mod consts;
mod client;
mod protocol;

#[macro_use]
mod util;

#[macro_use]
extern crate failure;

#[cfg(test)]
mod tests;

//use util::Hex;
use protocol::primitive::{String, StringList};
use protocol::message::{ClientInit};

use failure::Error;

#[tokio::main]
async fn main() -> Result<(), Error> {

    let mut client = client::Client::connect(
        "localhost",
        4242,
        false,
        true,
    ).await.unwrap();

    let mut features = StringList::new();
    features.push("SynchronizedMarkerLine".to_string());
    features.push("Authenticators".to_string());
    features.push("ExtendedFeatures".to_string());
    let client_init = ClientInit {
        client_version:String::from("Rust 0.0.0"),
        client_date: String::from("1579009211"),
        feature_list: features,
        client_features: 0x00008000,
    };

    client.handler().await?;
//    client.login("audron", "audron", client_init);

    Ok(())
} // the stream is closed here