Joins a CPG group for sending and receiving messages
(handle: &Handle, group: &str)
| 399 | |
| 400 | /// Joins a CPG group for sending and receiving messages |
| 401 | pub fn join(handle: &Handle, group: &str) -> Result<()> { |
| 402 | let res = unsafe { |
| 403 | let c_group = string_to_cpg_name(group)?; |
| 404 | ffi::cpg_join(handle.cpg_handle, &c_group) |
| 405 | }; |
| 406 | if res == ffi::CS_OK { |
| 407 | Ok(()) |
| 408 | } else { |
| 409 | Err(CsError::from_c(res)) |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | /// Leave the currently joined CPG group, another group can now be joined on |
| 414 | /// the same [Handle] or [finalize] can be called to finish using CPG |