pub struct Incoming { /* private fields */ }
Expand description
An incoming connection for which the server has not yet begun its parts of the handshake.
Implementations§
Source§impl Incoming
impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn accept(self) -> Result<Connecting, ConnectionError>
Attempts to accept this incoming connection (an error may still occur).
Errors occurring here are likely not caused by the application or remote. The QUIC connection listens on a normal UDP socket and any reachable network endpoint can send datagrams to it, solicited or not. Even if the first few bytes look like a QUIC packet, it might not even be a QUIC packet that is being received.
Thus it is common to simply log the errors here and accept them as something which can happen.
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn accept_with( self, server_config: Arc<ServerConfig>, ) -> Result<Connecting, ConnectionError>
Accepts this incoming connection using a custom configuration.
See accept()
for more details.
Sourcepub fn refuse(self)
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn refuse(self)
Rejects this incoming connection attempt.
Sourcepub fn retry(self) -> Result<(), RetryError>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn retry(self) -> Result<(), RetryError>
Responds with a retry packet.
This requires the client to retry with address validation.
Errors if remote_address_validated()
is true.
Sourcepub fn ignore(self)
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn ignore(self)
Ignores this incoming connection attempt, not sending any packet in response.
Sourcepub fn local_ip(&self) -> Option<IpAddr>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn local_ip(&self) -> Option<IpAddr>
Returns the local IP address which was used when the peer established the connection.
Sourcepub fn remote_address(&self) -> SocketAddr
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn remote_address(&self) -> SocketAddr
Returns the peer’s UDP address.
Sourcepub fn remote_address_validated(&self) -> bool
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated.
This means that the sender of the initial packet has proved that they can receive
traffic sent to self.remote_address()
.