Skip to content

Commit

Permalink
merge PR from: housleyjk#233
Browse files Browse the repository at this point in the history
  • Loading branch information
girard-g committed Dec 30, 2021
1 parent a2e05e7 commit 5414943
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,22 @@ impl Sender {
.map_err(Error::from)
}

/// Send a unicast message
///
/// send message to specific connection_id and token
pub fn unicast<M>(&self, msg: M, peer_token :Token, peer_connection_id : u32 ) -> Result<()>
where
M: Into<message::Message>,
{
self.channel
.send(Command {
token: peer_token,
signal: Signal::Message(msg.into()),
connection_id: peer_connection_id,
})
.map_err(Error::from)
}

/// Send a close code to the other endpoint.
#[inline]
pub fn close(&self, code: CloseCode) -> Result<()> {
Expand Down

0 comments on commit 5414943

Please sign in to comment.