5 releases
0.2.2 | Feb 23, 2020 |
---|---|
0.2.1 | Jan 29, 2020 |
0.2.0 | Jan 25, 2020 |
0.1.1 | Jan 23, 2020 |
0.1.0 | Jan 21, 2020 |
30 downloads per month
Used in icbc
26KB
456 lines
icb
Simple and small library for writing ICB clients
Usage
Add to Cargo.toml
:
[dependencies]
icb = "0.2"
In your main.rs
or lib.rs
you'll want to provide the connection parameters through
a Config
struct and use the init()
function to create a Client
and Server
.
The server-component provides a run()
function which is its main event loop.
In order for the client to send and receive messages and commands it needs its own loop
and communicate with the server via the msg_r: Receiver<Icbmsg>
and cmd_s: Sender<Command>
.
A working example can be found in the icb-client
crate.
use icb::Config;
fn main() {
let config = Config {
nickname: String::from("jasper"),
serverip: "192.168.115.245",
port: 7326,
group: "slackers",
};
let (client, mut server) = icb::init(config).unwrap();
}
Note that the Server
does not implement an ICB server, it is the component inside the icb
library responsible for communicating with the remote server.
ICB
Protocol documentation for ICB can be found here.
Dependencies
~435KB