Skip to content

Listening for two different ALPNs #3138

Answered by matheus23
joschisan asked this question in Q&A
Discussion options

You must be logged in to vote

The Endpoint stores a queue of Incoming packets that are detected to be either incoming connection attempts or just some kind of IP packet flying around:

/// State directly involved in handling incoming packets
struct RecvState {
    incoming: VecDeque<proto::Incoming>,
    connections: ConnectionSet,
    recv_buf: Box<[u8]>,
    recv_limiter: WorkLimiter,
}

When you endpoint.accept().await, you're locking the endpoint and popping off of this queue:

impl Future for Accept<'_> {
    type Output = Option<Incoming>;
    fn poll(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Self::Output> {
        let mut this = self.project();
        let mut endpoint = this.endpoint.inner.state.lock().

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by matheus23
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants