Skip to content

Commit f0f2346

Browse files
committed
Fixing impls
1 parent 8d649ca commit f0f2346

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/stack/share.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ where
128128
forward! {connect(socket: &mut Self::TcpSocket, address: SocketAddr) -> Result<(), nb::Error<<T as TcpClientStack>::Error>>}
129129
forward! {send(socket: &mut Self::TcpSocket, data: &[u8]) -> Result<usize, nb::Error<<T as TcpClientStack>::Error>>}
130130
forward! {receive(socket: &mut Self::TcpSocket, data: &mut [u8]) -> Result<usize, nb::Error<<T as TcpClientStack>::Error>>}
131-
forward! {is_connected(socket: &Self::TcpSocket) -> Result<bool, Self::Error>}
131+
forward! {is_open(socket: &Self::TcpSocket) -> Result<bool, Self::Error>}
132+
forward! {may_send(socket: &Self::TcpSocket) -> Result<bool, Self::Error>}
133+
forward! {may_receive(socket: &Self::TcpSocket) -> Result<bool, Self::Error>}
132134
forward! {close(socket: Self::TcpSocket) -> Result<(), Self::Error>}
133135
}
134136

src/stack/tcp.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,16 @@ impl<T: TcpClientStack> TcpClientStack for &mut T {
111111
T::connect(self, socket, remote)
112112
}
113113

114-
fn is_connected(&mut self, socket: &Self::TcpSocket) -> Result<bool, Self::Error> {
115-
T::is_connected(self, socket)
114+
fn is_open(&mut self, socket: &Self::TcpSocket) -> Result<bool, Self::Error> {
115+
T::is_open(self, socket)
116+
}
117+
118+
fn may_send(&mut self, socket: &Self::TcpSocket) -> Result<bool, Self::Error> {
119+
T::may_send(self, socket)
120+
}
121+
122+
fn may_receive(&mut self, socket: &Self::TcpSocket) -> Result<bool, Self::Error> {
123+
T::may_receive(self, socket)
116124
}
117125

118126
fn send(

0 commit comments

Comments
 (0)