@@ -23,7 +23,7 @@ impl UdpRequest {
2323
2424 fn read_response ( & mut self , socket : & mut UdpSocket ) -> Result < BoxResponseTrait , RequestError > {
2525 let cfg_buffer_size: usize = self
26- . get_config ( )
26+ . config
2727 . read ( )
2828 . map_or ( DEFAULT_BUFFER_SIZE , |data| data. buffer_size ) ;
2929 let mut tmp_buf: Vec < u8 > = vec ! [ 0u8 ; cfg_buffer_size] ;
@@ -42,7 +42,7 @@ impl UdpRequest {
4242 fn get_connection_socket ( & self , host : String , port : usize ) -> Result < UdpSocket , RequestError > {
4343 let host_port: String = format ! ( "{}:{}" , host. clone( ) , port) ;
4444 let cfg_timeout: u64 = self
45- . get_config ( )
45+ . config
4646 . read ( )
4747 . map_or ( DEFAULT_TIMEOUT , |data| data. timeout ) ;
4848 let timeout: Duration = Duration :: from_millis ( cfg_timeout) ;
@@ -67,11 +67,11 @@ impl RequestTrait for UdpRequest {
6767
6868 fn send ( & mut self , data : & [ u8 ] ) -> Self :: RequestResult {
6969 let cfg_timeout: Config = self
70- . get_config ( )
70+ . config
7171 . read ( )
7272 . map_or ( Config :: default ( ) , |data| data. clone ( ) ) ;
73- let host: String = cfg_timeout. get_host ( ) . clone ( ) ;
74- let port: usize = cfg_timeout. get_port ( ) . clone ( ) ;
73+ let host: String = cfg_timeout. host . clone ( ) ;
74+ let port: usize = cfg_timeout. port . clone ( ) ;
7575 let mut socket: UdpSocket = self . get_connection_socket ( host, port) ?;
7676 let res: Result < BoxResponseTrait , RequestError > = self . send_request ( & mut socket, data) ;
7777 res
0 commit comments