pub struct Incoming(/* private fields */);
Expand description
An incoming connection for which the server has not yet begun its part of the handshake
Implementations§
Source§impl Incoming
impl Incoming
Sourcepub fn accept(self) -> Result<Connecting, ConnectionError>
pub fn accept(self) -> Result<Connecting, ConnectionError>
Attempt to accept this incoming connection (an error may still occur)
Sourcepub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
pub fn accept_with( self, server_config: Arc<ServerConfig>, ) -> Result<Connecting, ConnectionError>
Accept this incoming connection using a custom configuration
See accept()
for more details.
Sourcepub fn retry(self) -> Result<(), RetryError>
pub fn retry(self) -> Result<(), RetryError>
Respond with a retry packet, requiring the client to retry with address validation
Errors if may_retry()
is false.
Sourcepub fn ignore(self)
pub fn ignore(self)
Ignore this incoming connection attempt, not sending any packet in response
Sourcepub fn local_ip(&self) -> Option<IpAddr>
pub fn local_ip(&self) -> Option<IpAddr>
The local IP address which was used when the peer established the connection
Sourcepub fn remote_address(&self) -> SocketAddr
pub fn remote_address(&self) -> SocketAddr
The peer’s UDP address
Sourcepub fn remote_address_validated(&self) -> bool
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()
.
If self.remote_address_validated()
is false, self.may_retry()
is guaranteed to be true.
The inverse is not guaranteed.
Sourcepub fn may_retry(&self) -> bool
pub fn may_retry(&self) -> bool
Whether it is legal to respond with a retry packet
If self.remote_address_validated()
is false, self.may_retry()
is guaranteed to be true.
The inverse is not guaranteed.
Sourcepub fn orig_dst_cid(&self) -> ConnectionId
pub fn orig_dst_cid(&self) -> ConnectionId
The original destination CID when initiating the connection