Allow spurious polling of sockets
This commit is contained in:
parent
4f17580ddd
commit
4c1b9730f8
15
src/io.rs
15
src/io.rs
|
@ -409,7 +409,10 @@ impl Future for BindTcpListener {
|
|||
Ok(builder) => {
|
||||
let builder = match Arc::try_unwrap(builder) {
|
||||
Ok(builder) => builder,
|
||||
Err(_) => unreachable!("Should never hold the inner Arc more than once"),
|
||||
Err(arc) => {
|
||||
this.io = Some(arc);
|
||||
return Poll::Pending;
|
||||
}
|
||||
};
|
||||
|
||||
match builder.try_finish() {
|
||||
|
@ -446,7 +449,10 @@ impl Future for BindUdpSocket {
|
|||
Ok(builder) => {
|
||||
let builder = match Arc::try_unwrap(builder) {
|
||||
Ok(builder) => builder,
|
||||
Err(_) => unreachable!("Should never hold the inner Arc more than once"),
|
||||
Err(arc) => {
|
||||
this.io = Some(arc);
|
||||
return Poll::Pending;
|
||||
}
|
||||
};
|
||||
|
||||
match builder.try_finish() {
|
||||
|
@ -483,7 +489,10 @@ impl Future for Connect {
|
|||
Ok(builder) => {
|
||||
let builder = match Arc::try_unwrap(builder) {
|
||||
Ok(builder) => builder,
|
||||
Err(_) => unreachable!("Should never hold the inner Arc more than once"),
|
||||
Err(arc) => {
|
||||
this.io = Some(arc);
|
||||
return Poll::Pending;
|
||||
}
|
||||
};
|
||||
|
||||
match builder.try_finish() {
|
||||
|
|
Loading…
Reference in a new issue