Merge pull request #121 from aatxe/better-ping-logic
Finalize 0.13.4 release.
This commit is contained in:
commit
0b2e2539c9
2 changed files with 8 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "irc"
|
||||
version = "0.13.3"
|
||||
version = "0.13.4"
|
||||
description = "A simple, thread-safe, and async-friendly library for IRC clients."
|
||||
authors = ["Aaron Weiss <awe@pdgn.co>"]
|
||||
license = "MPL-2.0"
|
||||
|
|
|
@ -69,12 +69,14 @@ where
|
|||
}
|
||||
|
||||
fn send_ping(&mut self) -> error::Result<()> {
|
||||
self.last_ping_sent = Instant::now();
|
||||
self.last_ping_data = format!("{}", Local::now().timestamp());
|
||||
let data = self.last_ping_data.clone();
|
||||
let last_ping_data = format!("{}", Local::now().timestamp());
|
||||
let data = last_ping_data.clone();
|
||||
let result = self.start_send(Command::PING(data, None).into())?;
|
||||
assert!(result.is_ready());
|
||||
self.poll_complete()?;
|
||||
if let AsyncSink::Ready = result {
|
||||
self.poll_complete()?;
|
||||
self.last_ping_sent = Instant::now();
|
||||
self.last_ping_data = last_ping_data;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue