feat: Add client/server use_channel variants (#228)
The goal here is to make the use of channels when interfacing with nodes less of a black box; the 0x8000 bit flip is a very surprising behavior if you're not already familiar with it.
This commit is contained in:
parent
4915d14cd5
commit
a81fc101fe
8 changed files with 46 additions and 14 deletions
|
|
@ -13,8 +13,8 @@ fn main() {
|
|||
let bearer = Bearer::connect_tcp("relays-new.cardano-testnet.iohkdev.io:3001").unwrap();
|
||||
|
||||
let mut plexer = StdPlexer::new(bearer);
|
||||
let handshake = plexer.use_channel(PROTOCOL_N2N_HANDSHAKE);
|
||||
let blockfetch = plexer.use_channel(PROTOCOL_N2N_BLOCK_FETCH);
|
||||
let handshake = plexer.use_client_channel(PROTOCOL_N2N_HANDSHAKE);
|
||||
let blockfetch = plexer.use_client_channel(PROTOCOL_N2N_BLOCK_FETCH);
|
||||
|
||||
plexer.muxer.spawn();
|
||||
plexer.demuxer.spawn();
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ fn main() {
|
|||
// setup the multiplexer by specifying the bearer and the IDs of the
|
||||
// miniprotocols to use
|
||||
let mut plexer = multiplexer::StdPlexer::new(bearer);
|
||||
let handshake = plexer.use_channel(PROTOCOL_N2C_HANDSHAKE);
|
||||
let statequery = plexer.use_channel(PROTOCOL_N2C_STATE_QUERY);
|
||||
let chainsync = plexer.use_channel(PROTOCOL_N2C_CHAIN_SYNC);
|
||||
let handshake = plexer.use_client_channel(PROTOCOL_N2C_HANDSHAKE);
|
||||
let statequery = plexer.use_client_channel(PROTOCOL_N2C_STATE_QUERY);
|
||||
let chainsync = plexer.use_client_channel(PROTOCOL_N2C_CHAIN_SYNC);
|
||||
|
||||
plexer.muxer.spawn();
|
||||
plexer.demuxer.spawn();
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ fn main() {
|
|||
// setup the multiplexer by specifying the bearer and the IDs of the
|
||||
// miniprotocols to use
|
||||
let mut plexer = StdPlexer::new(bearer);
|
||||
let handshake = plexer.use_channel(PROTOCOL_N2N_HANDSHAKE);
|
||||
let blockfetch = plexer.use_channel(PROTOCOL_N2N_BLOCK_FETCH);
|
||||
let chainsync = plexer.use_channel(PROTOCOL_N2N_CHAIN_SYNC);
|
||||
let handshake = plexer.use_client_channel(PROTOCOL_N2N_HANDSHAKE);
|
||||
let blockfetch = plexer.use_client_channel(PROTOCOL_N2N_BLOCK_FETCH);
|
||||
let chainsync = plexer.use_client_channel(PROTOCOL_N2N_CHAIN_SYNC);
|
||||
|
||||
plexer.muxer.spawn();
|
||||
plexer.demuxer.spawn();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue