pub struct Listen {
    pub addr: SocketAddr,
    /* private fields */
}
Expand description

A TCP listener which is connected to a Sock

Example

Listen on all interfaces, on an OS-selected TCP port

use pwn::tubes::listen::Listen;
let mut listener = Listen::new(Some("0.0.0.0"), None);

Fields

addr: SocketAddr

The SocketAddr we’re listening on

Implementations

Create a TCP listener. By default, it will listen on all interfaces, and a port randomly chosen by the OS.

Retrieve the internal SocketAddr of the listener.

Trait Implementations

Retrieve a mutable reference to the Sock’s internal Buffer. On first call, will block until a connection is received.

Fill the Sock’s internal Buffer. On first call, will block until a connection is received.

Close the internal Sock.

Retrieve all data from the Tube. Read more

Receives from the Tube, returning once any data is available.

Receives n bytes from the Tube.

Receive all data from the Tube, repeatedly reading with the given timeout.

Writes data to the Tube.

Appends a newline to the data before writing it to the Tube.

Receive until the given delimiter is received.

Receive from the tube until a newline is received.

Get an interactive prompt for the connection. A second thread will print messages as they arrive. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more