Skip to content

Commit

Permalink
add: new_default function to client tls structure
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscaOrtegaG committed Oct 9, 2024
1 parent 4ce20b6 commit 9936fef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/client/tls_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,26 @@ pub struct ClientTLSConnection {
server_addr: IpAddr,
/// Read time timeout
timeout: tokio::time::Duration,
new_default: fn(IpAddr, Duration) -> Self,
}

#[async_trait]
impl ClientConnection for ClientTLSConnection {

/// Creates TCPConnection
fn new(server_addr:IpAddr, timeout: Duration) -> Self {
fn new(server_addr:IpAddr, timeout: Duration, new_default: usize) -> Self {
ClientTLSConnection {
server_addr: server_addr,
timeout: timeout,
new_default: ClientTLSConnection::new_default,
}
}

fn new_default(server_addr:IpAddr, timeout: Duration) -> Self {
ClientTLSConnection {
server_addr: server_addr,
timeout: timeout,
new_default: ClientTLSConnection::new_default,
}
}

Expand Down

0 comments on commit 9936fef

Please sign in to comment.