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
mod client;
mod event;
mod msg;
mod server;

pub use client::{
    error::AskError,
    error::ExecAskError,
    error::FileAskError,
    error::TellError,
    file::RemoteFile,
    proc::{RemoteProc, RemoteProcStatus},
    Client, ClientBuilder, ConnectedClient,
};
pub use event::{AddrEventManager, EventManager};
pub use msg::{
    content::{self, Content},
    Msg, MsgError,
};
pub use server::{
    fs::{FileSystemManager, LocalDirEntry, LocalFile, LocalFileHandle},
    proc::{ExitStatus, LocalProc},
    ListeningServer, Server, ServerBuilder,
};

use std::net::SocketAddr;

/// Transportation medium to use with the client/server
#[derive(Clone, Debug)]
pub enum Transport {
    /// TCP-based communication
    /// - If binding, will use addr available
    /// - If connecting, will use first addr that succeeds
    Tcp(Vec<SocketAddr>),

    /// UDP-based communication
    /// - If binding, will use addr available
    /// - If connecting, will use first addr that succeeds, which should be
    ///   the very first addr in most cases as no network validation is used
    Udp(Vec<SocketAddr>),
}