Skip to content

Conversation

@lexnv
Copy link
Collaborator

@lexnv lexnv commented Jan 27, 2026

No description provided.

Comment on lines +670 to +685
// /// Start running event loop of [`WebRtcConnection`].
// pub async fn run(mut self) {
// tracing::trace!(
// target: LOG_TARGET,
// peer = ?self.peer,
// "start webrtc connection event loop",
// );

// let _ = self
// .protocol_set
// .report_connection_established(self.peer, self.endpoint.clone())
// .await;

// self.run_event_loop().await;
// }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// /// Start running event loop of [`WebRtcConnection`].
// pub async fn run(mut self) {
// tracing::trace!(
// target: LOG_TARGET,
// peer = ?self.peer,
// "start webrtc connection event loop",
// );
// let _ = self
// .protocol_set
// .report_connection_established(self.peer, self.endpoint.clone())
// .await;
// self.run_event_loop().await;
// }

pub async fn next(&mut self) -> Option<TransportEvent> {
loop {
// First, check if we have a pending accept future to poll
if let Some((peer, endpoint, mut future)) = self.pending_accept.take() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we "stop" here everything when one connection is waiting for its accept to finish?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is not ok, especially under load. The PR is entirely vibed as PoC for @tdimitrov 🙏

I'll need to rewrite this with some FuturesUnordered and see ask Tsvetomir for another testing round 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants