Skip to content

Commit a8a53e3

Browse files
committed
unify the way we cancel heartbeat
1 parent 6a859d0 commit a8a53e3

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/channels.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ impl Channels {
122122
}
123123

124124
pub(crate) fn set_connection_closing(&self) {
125+
self.heartbeat.cancel();
125126
self.connection_status.set_state(ConnectionState::Closing);
126127
for channel in self.lock_inner().channels.values() {
127128
channel.set_closing(None);

src/io_loop.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ impl IoLoop {
165165
res = self.critical_error(err);
166166
}
167167
}
168-
self.heartbeat.cancel();
169168
self.clear_serialized_frames(self.frames.poison().unwrap_or(
170169
ErrorKind::InvalidConnectionState(ConnectionState::Closed).into(),
171170
));
@@ -188,7 +187,6 @@ impl IoLoop {
188187

189188
fn stop(&mut self) {
190189
self.status = Status::Stop;
191-
self.heartbeat.cancel();
192190
}
193191

194192
fn poll_socket_events(&mut self) {

0 commit comments

Comments
 (0)