File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
11
11
- Bump dependency version of ` no-std-net ` to ` v0.6 ` .
12
12
- Bump MSRV to 1.53.0 due to ` no-std-net ` 's use of or-patterns.
13
13
- Added support for ` core::net ` with the ` ip_in_core ` feature.
14
+ - [ breaking] New APIs added to ` TcpClientStack ` to support more robust understanding of the TCP
15
+ socket state
16
+ * New APIs include ` is_open() ` , ` may_send() ` , and ` may_recv() `
14
17
15
18
## [ 0.6.0] - 2021-05-25
16
19
Original file line number Diff line number Diff line change @@ -27,8 +27,21 @@ pub trait TcpClientStack {
27
27
remote : SocketAddr ,
28
28
) -> nb:: Result < ( ) , Self :: Error > ;
29
29
30
- /// Check if this socket is connected
31
- fn is_connected ( & mut self , socket : & Self :: TcpSocket ) -> Result < bool , Self :: Error > ;
30
+ /// Determine if a socket is opened.
31
+ ///
32
+ /// Returns `Ok(true)` if the TCP socket is actively ingressing and egressing packets. This
33
+ /// corresponds to any TCP state that is not `CLOSED` or `TIME-WAIT`.
34
+ fn is_open ( & mut self , socket : & Self :: TcpSocket ) -> Result < bool , Self :: Error > ;
35
+
36
+ /// Check if the TCP socket can transmit data.
37
+ ///
38
+ /// Returns `Ok(true)` if the TCP transmit half is open and connected.
39
+ fn may_send ( & mut self , socket : & Self :: TcpSocket ) -> Result < bool , Self :: Error > ;
40
+
41
+ /// Check if the TCP socket can receive data.
42
+ ///
43
+ /// Returns `Ok(true)` if the TCP receive half is open and connected.
44
+ fn may_receive ( & mut self , socket : & Self :: TcpSocket ) -> Result < bool , Self :: Error > ;
32
45
33
46
/// Write to the stream.
34
47
///
You can’t perform that action at this time.
0 commit comments