Skip to content

Conversation

@134130
Copy link

@134130 134130 commented Nov 28, 2025

What

  • Use ep.ReadContext to detect the netTun is closed, and remove the WriteNotify implementation.
  • This is more simpler than owning some channel
  • I've tested this in my internal project

Why

  • I also experienced the same problem as tun/netstack: fix race during (*netTun).Close() #85
  • When closing the netTun while the (*endpoint) is on handshaking, the Close() blocks forever, because the incomingPacket channel is closed but Write() trying to send a view.
  • Therefore, when using netTun with http.Transport, you will encounter a phenomenon where the number of goroutines gradually increases over time.

}

view := pkb.ToView()
pkb.DecRef()
Copy link
Author

Choose a reason for hiding this comment

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

need to add view.Release

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant