Minor fixes and error tolerance

This commit is contained in:
2022-09-24 20:49:00 +02:00
parent 230d5d1c82
commit f754030997
4 changed files with 36 additions and 24 deletions

View File

@@ -1,5 +1,3 @@
use std::string;
pub struct HandShake<'a> {
len_pack: u8,
len_dom: u8,
@@ -19,7 +17,7 @@ impl<'a> HandShake<'a>{
}
}
pub fn getHostName(&self) -> String {
pub fn get_host_name(&self) -> String {
String::from_utf8(self.datagram[5 .. ((self.len_dom+5) as usize)].to_vec()).unwrap()
}