Skip to content

Conversation

@cathay4t
Copy link
Member

Introduced new_multicast_connection() and
new_multicast_connection_with_socket() taking &[MulticastGroup] as
argument.

Example code:

let (conn, mut _handle, mut messages) = new_multicast_connection(&[
    MulticastGroup::Link,
]).unwrap()

// Spawn `Connection` to start polling netlink socket.
tokio::spawn(conn);

// Start receiving events through `messages` channel.
while let Some((message, _)) = messages.next().await {
    let payload = message.payload;
    println!("{payload:?}");
}

Example code updated.

Introduced `new_multicast_connection()` and
`new_multicast_connection_with_socket()` taking `&[MulticastGroup]` as
argument.

Example code:
```rust
let (conn, mut _handle, mut messages) = new_multicast_connection(&[
    MulticastGroup::Link,
]).unwrap()

// Spawn `Connection` to start polling netlink socket.
tokio::spawn(conn);

// Start receiving events through `messages` channel.
while let Some((message, _)) = messages.next().await {
    let payload = message.payload;
    println!("{payload:?}");
}
```

Example code updated.

Signed-off-by: Gris Ge <[email protected]>
@cathay4t cathay4t merged commit 84dfe67 into rust-netlink:main Oct 29, 2025
5 checks passed
@cathay4t cathay4t deleted the monitor branch October 29, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant