Fix udp port check retry and check all udp ports (#10385)

* Don't start if udp port is really closed

* Fully check all udp ports

* Remove test code.......

* Add tests and adjust impl a bit

* Add comment

* Move comment a bit

* Move a bit

* clean ups
This commit is contained in:
Ryo Onodera
2020-06-15 07:36:08 +09:00
committed by GitHub
parent 0d38257dbb
commit a39df7ee5d
3 changed files with 199 additions and 70 deletions

View File

@@ -7,10 +7,12 @@ use tokio_codec::{BytesCodec, Decoder};
pub type IpEchoServer = Runtime;
pub const MAX_PORT_COUNT_PER_MESSAGE: usize = 4;
#[derive(Serialize, Deserialize, Default)]
pub(crate) struct IpEchoServerMessage {
tcp_ports: [u16; 4], // Fixed size list of ports to avoid vec serde
udp_ports: [u16; 4], // Fixed size list of ports to avoid vec serde
tcp_ports: [u16; MAX_PORT_COUNT_PER_MESSAGE], // Fixed size list of ports to avoid vec serde
udp_ports: [u16; MAX_PORT_COUNT_PER_MESSAGE], // Fixed size list of ports to avoid vec serde
}
impl IpEchoServerMessage {