keepalive work
This commit is contained in:
@@ -539,6 +539,22 @@ impl LocalNodeInfo {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::derive_hash_xor_eq)]
|
||||
#[derive(Debug, PartialOrd, Ord, Hash, Serialize, Deserialize, EnumSetType)]
|
||||
// Keep member order appropriate for sorting < preference
|
||||
// Must match DialInfo order
|
||||
pub enum LowLevelProtocolType {
|
||||
UDP,
|
||||
TCP,
|
||||
}
|
||||
|
||||
impl LowLevelProtocolType {
|
||||
pub fn is_connection_oriented(&self) -> bool {
|
||||
matches!(self, LowLevelProtocolType::TCP)
|
||||
}
|
||||
}
|
||||
pub type LowLevelProtocolTypeSet = EnumSet<LowLevelProtocolType>;
|
||||
|
||||
#[allow(clippy::derive_hash_xor_eq)]
|
||||
#[derive(Debug, PartialOrd, Ord, Hash, Serialize, Deserialize, EnumSetType)]
|
||||
// Keep member order appropriate for sorting < preference
|
||||
@@ -557,6 +573,12 @@ impl ProtocolType {
|
||||
ProtocolType::TCP | ProtocolType::WS | ProtocolType::WSS
|
||||
)
|
||||
}
|
||||
pub fn low_level_protocol_type(&self) -> LowLevelProtocolType {
|
||||
match self {
|
||||
ProtocolType::UDP => LowLevelProtocolType::UDP,
|
||||
ProtocolType::TCP | ProtocolType::WS | ProtocolType::WSS => LowLevelProtocolType::TCP,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub type ProtocolTypeSet = EnumSet<ProtocolType>;
|
||||
|
||||
|
Reference in New Issue
Block a user