static DEFAULT_TIMEOUT: Option<u64> = Some(500); // [ms].
pub struct Server {
- acceptor: TcpAcceptor
+ acceptor: TcpAcceptor,
}
pub struct Client {
}
}
- /// Send some valid and not-valid packets to the server and check the result.
+ /// Sends some valid and not-valid packets to the server and check the result.
/// For each test a new client is created.
pub fn start_tests(address: &str, port: u16, variant: packet::Variant) {
let execute = |f: &mut |&mut Client| -> bool| -> bool {
println!("[{}] time: {}. {}", prefix, self.current_timestamp, s);
}
- /// Send a packet and wait for an answer synchronously.
+ /// Sends a packet and wait for an answer synchronously.
fn send_with_result(&mut self, p: PacketType) -> IoResult<ReadingResult> {
match self.send(p) {
Err(e) => Err(e),
}
}
- /// Send arbitrary data and wait for an answer synchronously.
- /// Do not increment the current timestamp.
+ /// Sends arbitrary data and wait for an answer synchronously.
+ /// Doesn't increment the current timestamp.
pub fn send_raw_with_result(&mut self, p: &[u8]) -> IoResult<ReadingResult> {
self.socket.set_timeout(DEFAULT_TIMEOUT);
match self.socket.write(p) {