Struct bluer::l2cap::SeqPacketListener
source · [−]pub struct SeqPacketListener { /* private fields */ }
l2cap
only.Expand description
An L2CAP socket server, listening for SeqPacket connections.
Implementations
sourceimpl SeqPacketListener
impl SeqPacketListener
sourcepub async fn bind(sa: SocketAddr) -> Result<Self>
pub async fn bind(sa: SocketAddr) -> Result<Self>
Creates a new Listener, which will be bound to the specified socket address.
Specify SocketAddr::any_br_edr or SocketAddr::any_le for any local adapter address with a dynamically allocated PSM.
sourcepub async fn accept(&self) -> Result<(SeqPacket, SocketAddr)>
pub async fn accept(&self) -> Result<(SeqPacket, SocketAddr)>
Accepts a new incoming connection from this listener.
sourcepub fn poll_accept(
&self,
cx: &mut Context<'_>
) -> Poll<Result<(SeqPacket, SocketAddr)>>
pub fn poll_accept(
&self,
cx: &mut Context<'_>
) -> Poll<Result<(SeqPacket, SocketAddr)>>
Polls to accept a new incoming connection to this listener.
sourcepub unsafe fn from_raw_fd(fd: RawFd) -> Result<Self>
pub unsafe fn from_raw_fd(fd: RawFd) -> Result<Self>
Constructs a new SeqPacketListener from the given raw file descriptor.
The file descriptor must have been set to non-blocking mode.
This function consumes ownership of the specified file descriptor. The returned object will take responsibility for closing it when the object goes out of scope.
Safety
If the passed file descriptor is invalid, undefined behavior may occur.
Trait Implementations
sourceimpl AsRawFd for SeqPacketListener
impl AsRawFd for SeqPacketListener
sourceimpl AsRef<Socket<SeqPacket>> for SeqPacketListener
impl AsRef<Socket<SeqPacket>> for SeqPacketListener
sourceimpl Debug for SeqPacketListener
impl Debug for SeqPacketListener
sourceimpl FromRawFd for SeqPacketListener
impl FromRawFd for SeqPacketListener
sourceunsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of Self
from the given raw file
descriptor.
The file descriptor must have been set to non-blocking mode.
Panics
Panics when the conversion fails. Use SeqPacketListener::from_raw_fd for a non-panicking variant.