tests pass

This commit is contained in:
John Smith
2021-12-25 10:58:43 -05:00
parent 23abaa3c99
commit 78ff6d0c61
4 changed files with 30 additions and 14 deletions

View File

@@ -585,6 +585,14 @@ impl DialInfo {
Self::WSS(di) => di.socket_address.to_socket_addr(),
}
}
pub fn to_peer_address(&self) -> PeerAddress {
match self {
Self::UDP(di) => PeerAddress::new(di.socket_address, ProtocolType::UDP),
Self::TCP(di) => PeerAddress::new(di.socket_address, ProtocolType::TCP),
Self::WS(di) => PeerAddress::new(di.socket_address, ProtocolType::WS),
Self::WSS(di) => PeerAddress::new(di.socket_address, ProtocolType::WSS),
}
}
pub fn request(&self) -> Option<String> {
match self {
Self::UDP(_) => None,