Function create_bi_socket

Source
pub fn create_bi_socket(
    if_index: u32,
    if_queue: u32,
    config: Option<XdpConfig>,
) -> Result<(TxSocket, RxSocket), Error>
Expand description

Creates a pair of sockets (TxSocket, RxSocket) for bidirectional communication.

This is a convenience wrapper around create_socket for bidirectional use cases. The UMEM frame pool is split between the two sockets.

§Arguments

  • if_index - The index of the network interface to use.
  • if_queue - The queue ID of the network interface to use.
  • config - Optional XdpConfig to customize the sockets.

§Returns

A Result containing a tuple of (TxSocket, RxSocket) on success, or an io::Error on failure.