Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unicast method #233

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,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, utoken :Token, ucid : u32 ) -> Result<()> where
perlish marked this conversation as resolved.
Show resolved Hide resolved
M: Into<message::Message>,
{
self.channel
.send(Command {
token: utoken,
signal: Signal::Message(msg.into()),
connection_id: ucid,
})
.map_err(Error::from)
}


/// Send a close code to the other endpoint.
#[inline]
pub fn close(&self, code: CloseCode) -> Result<()> {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ pub struct Settings {
impl Default for Settings {
fn default() -> Settings {
Settings {
max_connections: 100,
queue_size: 5,
max_connections: 1_000_000,
perlish marked this conversation as resolved.
Show resolved Hide resolved
queue_size: 20,
panic_on_new_connection: false,
panic_on_shutdown: false,
fragments_capacity: 10,
Expand Down