pub struct VsockListener {
sock: VsockSocket,
}
Expand description
Represents a virtual socket server.
Fields§
§sock: VsockSocket
Implementations§
source§impl VsockListener
impl VsockListener
sourcepub fn bind<A: ToSocketAddr>(addr: A) -> Result<VsockListener>
pub fn bind<A: ToSocketAddr>(addr: A) -> Result<VsockListener>
Creates a new VsockListener
bound to the specified port on the current virtual socket
endpoint.
sourcepub fn local_port(&self) -> Result<u32>
pub fn local_port(&self) -> Result<u32>
Returns the port that this listener is bound to.
sourcepub fn accept(&self) -> Result<(VsockStream, SocketAddr)>
pub fn accept(&self) -> Result<(VsockStream, SocketAddr)>
Accepts a new incoming connection on this listener. Blocks the calling thread until a
new connection is established. When established, returns the corresponding VsockStream
and the remote peer’s address.
pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<()>
Trait Implementations§
source§impl AsRawFd for VsockListener
impl AsRawFd for VsockListener
Auto Trait Implementations§
impl RefUnwindSafe for VsockListener
impl Send for VsockListener
impl Sync for VsockListener
impl Unpin for VsockListener
impl UnwindSafe for VsockListener
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more