- the
tokiodependency has thert-multi-threadfeature enabled by default in order to not fail to build in crates that don't use it on their own
NodeConfig.fatal_io_errorsthat specifies which IO errors should break connections
- the list of read errors considered fatal is longer
- connections are now broken on write errors considered fatal too
- the
io::ErrorKinds returned byNode::connectare more specific
- the default value for
NodeConfig.conn_inbound_queue_depthis now 64 instead of 256 - adjusted dependency features further
- (internal) automatically test for potential memleaks
- adjusted dependency features
Handshaking::perform_handshakethat has no default implementationconnections::Connectionis now re-exported
Handshakingnow requiresSelf: Clone + Send + Sync + 'staticHandshaking::enable_handshakingnow has a default implementationNodeConfig.max_protocol_setup_time_msis nowNodeConfig.max_handshake_time_msand only applies toHandshaking
NodeStats.connectionsand the relatedNodeStats::register_connection(unused)
- the
fixed_length_crusadersexample needed a bump to the defaultmax_protocol_setup_time_msintroduced in0.16.2
connections::ConnectionSideis now re-exported, i.e. it can be imported withuse pea2pea::ConnectionSide
NodeConfig.max_protocol_setup_time_ms, which restricts the amount of time that a connection can take to enact all its protocols; set to 3s by default
- the reading loop in the default
Reading::enable_readingimpl is now delayed until the connection is fully established
- in the default
Reading::enable_readingimpl, the message processing task is now spawned before the message reading task
- there is now an additional anti-self-connect safeguard in
Node::connect
Reading::read_from_streamandWriting::write_to_streamare now generic overAsyncReadandAsyncWriterespectively and their arguments were extendedReading::read_from_streamnow returnsio::Result<usize>instead ofio::Result<()>Connection.readernow containsOption<OwnedReadHalf>Connection.writernow containsOption<OwnedWriteHalf>
connections::{ConnectionReader, ConnectionWriter}
NodeConfig.listener_ip
- the default IP the node listens at is now
Ipv4Addr::UNSPECIFIEDinstead ofIpv4Addr::LOCALHOST
ReadingHandlerandWritingHandlerare now a commonProtocolHandlerapplicable also toHandshakingNodeConfig.{reading_handler_queue_depth, writing_handler_queue_depth}were merged into.protocol_handler_queue_depth- instead of
Node, keep a copy of itsSpaninConnectionReader&ConnectionWriter - renamed
NodeConfig.invalid_message_penalty_secsto.invalid_read_delay_secs Node::{reading_handler, writing_handler}methods are now private
Node::shutdownnow also shuts down the handshaking task ifHandshakingis enabled- the
Nodeno longer panics on attempts to send to dying connections - corrected the doc on
NodeConfig.invalid_message_penalty_secs(now.invalid_read_delay_secs)
- the
Nodecan no longer connect to its own listening address
- exposed previously public
Nodemembers as public methods Connectionnow drops its tasks in reverse order
Node::shut_downthat performs a full shutdown of the node
Pea2Pea::nodenow returns a&Node- tweaked a few logs
Connections now shut their associated tasks down when dropped- critical protocol failures no longer cause panics in their main tasks
- some edge cases in protocol handling
NodeConfig.max_connectionswith a default value of 100
- updading
PeerStatsno longer implicitly adds an entry
PeerStats.last_connectedno longer shows a timestamp if there were no connectionsPeerStats.times_connectedno longer shows one extra connectionNode::connectis now guarded against overlapping connection attempts
NodeConfig.max_allowed_failures- not used internally, not necessarily needed, easy to handle on user sidePeerStats.last_seen- ditto
Writing::write_to_streamwith a default implementation- a new example with fixed-length messages
- average throughput is now displayed at the end of the benchmark in
benches
- renamed
Node::initiate_connectionto::connect Writing::write_messagenow requires aSocketAddrand&mut [u8]instead of&mut ConnectionWriter
- a test with a duplicate connection
- an example in the README
- refactored code around establishing connections
Connections::disconnectis now::removeNodeStats::register_connectionnow happens as soon as the connection is barely establishedKnownPeers::adddoesn't occur before the connection is fully establishedConnectionnow carries its task handles in a singleVecConnectionno longer usesOnceCellinternally (Optionis used instead)Connectionnow carriesConnectionReaderandConnectionWriterwhile the procols are being enabledHandshakingObjects,ReadingObjects, andWritingObjectsare now merged intoReturnableConnection
Connection::send_message(unused)
- improved and extended some logs
- added more comments
- a small refactoring in
Node::new
- the listening task handle is now kept within the
Node - a new
clippylint introduced in Rust 1.49
ConnectionWriterobject was isolated fromConnectionWritingprotocol was introducedNodeConfighas gained some new fields
- the crate's structure and exports were overhauled
connectionmodule was merged intoconnectionsMessagingprotocol becameReadingInboundHandlerbecameReadingHandlerMessagingObjectsbecameReadingObjects
- protocol handlers now carry handles to the tasks they have spawned