You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The coap_client::RequestOptions structs has a retries field that specifies a number of request retries. Following a field documentation, one might think that by setting retries: 0, the client would perform a request only once.
However, this tests succeeds:
#[tokio::test]
async fn would_fail() {
let _ = SimpleLogger::init(LevelFilter::Debug, Config::default());
let mut client = TokioClient::connect("coap://coap.me:5683", &ClientOptions::default())
.await
.unwrap();
let opts = RequestOptions {
retries: 0,
timeout: Duration::from_secs(1000),
..Default::default()
};
let resp = client
.get("hello", &opts)
.await;
assert!(resp.is_err());
if let Err(Error::Transport(err)) = resp {
assert_eq!(err.kind(), ErrorKind::TimedOut);
}
client.close().await.unwrap();
}
The text was updated successfully, but these errors were encountered:
apohrebniak
added a commit
to apohrebniak/rust-coap-client
that referenced
this issue
Nov 2, 2023
The
coap_client::RequestOptions
structs has aretries
field that specifies a number of request retries. Following a field documentation, one might think that by settingretries: 0
, the client would perform a request only once.However, this tests succeeds:
The text was updated successfully, but these errors were encountered: