Skip to content

Commit

Permalink
flexible connect-ack transition (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayato authored Oct 5, 2020
1 parent 717a697 commit b67d1dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod version;
pub use self::error::MqttError;
pub use self::server::MqttServer;
pub use self::session::Session;
pub use self::topic::Topic;
pub use self::topic::{Topic, Level as TopicLevel};

// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
pub const TCP_PORT: u16 = 1883;
Expand Down
4 changes: 4 additions & 0 deletions src/v5/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ impl<Io> Connect<Io> {

ConnectAck { io: self.io, sink: self.sink, session: None, packet }
}

pub fn fail_with<St>(self, ack: codec::ConnectAck) -> ConnectAck<Io, St> {
ConnectAck { io: self.io, sink: self.sink, session: None, packet: ack }
}
}

impl<T> fmt::Debug for Connect<T> {
Expand Down

0 comments on commit b67d1dc

Please sign in to comment.