mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
rkyv-test-server: support multiple callbacks for one client
There doesn't seem to be a compelling reason to limit clients to just one callback. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
c1fe20c06b
commit
f58f82a40d
1 changed files with 6 additions and 8 deletions
|
|
@ -142,14 +142,12 @@ fn test_main() -> ! {
|
|||
{
|
||||
let sid = xous::SID::from_u32(arg1 as _, arg2 as _, arg3 as _, arg4 as _);
|
||||
let cb_conn = Some(xous::connect(sid).unwrap());
|
||||
// Add this callback connection to the list of callbacks if it doesn't
|
||||
// already exist.
|
||||
if !logstring_callback_connections.contains(&cb_conn) {
|
||||
for entry in logstring_callback_connections.iter_mut() {
|
||||
if *entry == None {
|
||||
*entry = cb_conn;
|
||||
break;
|
||||
}
|
||||
// Add this callback connection to the list of callbacks. If `AddLogStringCallback`
|
||||
// is called multiple times, then it will receive multiple callbacks.
|
||||
for entry in logstring_callback_connections.iter_mut() {
|
||||
if *entry == None {
|
||||
*entry = cb_conn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue